PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php mysqli_report(MYSQLI_REPORT_ALL ^ MYSQLI_REPORT_STRICT); $query = "SELECT 'ok 1'; SELECT 'ok 2'; SElllllECT 'failed'; SELECT 'ok 3'"; if($mysqli->multi_query($query)){ do{ if($result=$mysqli->store_result()){ while($row=mysqli_fetch_row($result)){ echo "$row[0]\n"; } } } while($mysqli->more_results() && $mysqli->next_result()); } if($error=$mysqli->error){ echo "<p>Syntax Error @ $current_table Query<br>$current_query<br>Error: $error</p>"; } return; $result = $mysqli->multi_query($query); if ($result) { do { // fetch results if (!$mysqli->more_results()) { break; } if (!$mysqli->next_result()) { echo $mysqli->error; break; } } while (true); } echo $mysqli->error; return; if ($mysqli->multi_query($query)) { do { /* store first result set */ if ($result = $mysqli->store_result()) { while ($row = $result->fetch_row()) { printf("%s\n", $row[0]); } $result->free(); } /* print divider */ if ($mysqli->more_results()) { printf("-----------------\n"); } echo $mysqli->error, $result->error; } while ($mysqli->next_result()); }
Show:  
Copy Clear