mysqli:它可以在一个语句中准备多个查询吗?
我想知道我是否可以准备一个执行多个查询的mysqli语句:
mysqli->prepare(query1 ...1,2,3 param...; query2...4,5 param...);or mysqli->prepare(insert into ...1,2,3 param...; insert into...4,5 param...);and after all mysqli->bind_param("sssss", 1, 2, 3, 4, 5);
以这种方式它会产生错误:在...中的非对象上调用成员函数bind_param()
$stmt = $sql->getQueryPrepare("INSERT INTO user (id_user, username, pw, email) VALUES (?,?,?,?); INSERT INTO process (id_user, idp) VALUES (?,?);");$stmt->bind_param("ssssss",$id, $username, $pw, $email, $id, $idp);$stmt->execute();$stmt->close();
森栏
梦里花落0921