PHP 8.5.0 Alpha 4 available for testing

Voting

: max(seven, eight)?
(Example: nine)

The Note You're Voting On

skunkbad
11 years ago
I appreciate the advice from crmccar at gmail dot com regarding the proper way to check for errors, but I would get an error with his/her code. I fixed it by changing the code a little:

<?php
$sql
= file_get_contents( 'sql/test_' . $id . '_data.sql');

$query_array = explode(';', $sql);

// Run the SQL
$i = 0;
if(
$this->mysqli->multi_query( $sql ) )
{
do {
$this->mysqli->next_result();

$i++;
}
while(
$this->mysqli->more_results() );
}

if(
$this->mysqli->errno )
{
die(
'<h1>ERROR</h1>
Query #'
. ( $i + 1 ) . ' of <b>test_' . $id . '_data.sql</b>:<br /><br />
<pre>'
. $query_array[ $i ] . '</pre><br /><br />
<span style="color:red;">'
. $this->mysqli->error . '</span>'
);
}
?>

<< Back to user notes page

To Top