$mysqli-query does not execute multiple statements
Hi!
I am trying to execute multiple statements after opening a MySqli connection...the first two execute and the final one does not.
What am I doing wrong?
MySQL version = the last one before 8.0.
Thank you,
Jason
--
$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
if(! $conn ){
die('Could not connect: ' . mysqli_error());
}
// This works
$sql = "call spInsertStuff(17, 'John', 'Wilson', 'Spokane', 'US');";
$conn->query($sql);
// This works
$sql = "CALL spSelectOneRow('" . $name . "', '" . $dob . "', '" . $startdate. "', '" . $enddate . "');";
echo $sql;
$result = $conn->query($sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$transactionid= $row['transactionid']; (repeat for all fields)
}
}
// This does NOT work
$sql = "call spInsertStuff(18, 'Jane', 'Wooder', 'South Jersey', 'US');";
$conn->query($sql);
Why doesn't the third query execute? I am getting no errors or warnings on my screen or in error log.