Organizational Research By

Surprising Reserch Topic

mysqli can it prepare multiple queries in one statement


mysqli can it prepare multiple queries in one statement  using -'php,mysql,mysqli,prepared-statement'

I would like to know if i can prepare one mysqli statement that executes multiple queries:

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);


In that way it make error: Call to a member function bind_param() on a non-object in...

$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();

    
asked Oct 6, 2015 by badhwar.rohit
0 votes
10 views



Related Hot Questions



Government Jobs Opening


...