Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php //turn the exception more off mysqli_report(MYSQLI_REPORT_ALL ^ MYSQLI_REPORT_STRICT); $query = "SELECT 'ok 1'; SELECT 'ok 2'; SElllllECT 'failed'; # error in the 3rd query SELECT 'ok 3'"; if(mysqli_multi_query($mysqli,$query)){ do{ list($current_table,$current_query)=each($queries); if($current_table!="CURRENT_USER"){ printf("-----------------\n"); } if($result=mysqli_store_result($mysqli)){ if(mysqli_num_rows($result)<1){ echo "<p>Logic Error @ $current_table Query<br>$current_query</p>"; }else{ while($row=mysqli_fetch_row($result)){ printf("%s\n",$row[0]); } } mysqli_free_result($result); } } while(mysqli_more_results($mysqli) && mysqli_next_result($mysqli)); }else{ list($current_table,$current_query)=each($queries); } if($error=mysqli_error($mysqli)){ echo "<p>Syntax Error @ $current_table Query<br>$current_query<br>Error: $error</p>"; }
Copy Clear