I just recently installed MySQL 3.23.30-gamma on my Linux Mandrake 7.0 machine, which is running Apache 1.3.14 with PHP3. When I wrote a PHP function for making database queries:
function dbquery( $Query, $subdb )
{
$subdb = "synapse_entertainment_com";
mysql_pconnect( "localhost", "<username>", "<pass"> );
$result = mysql_db_query( $subdb, $Query );
return array(
"result" => $result,
"numrows" => @mysql_num_rows( $result ),
"numfields" => @mysql_num_fields( $result ),
"error" => @mysql_error();
);
}
and the following PHP code is parsed:
$Query = "INSERT INTO test_table ( name, email ) VALUES ( 'moo', <!-- e --><a href="mailto:'[email protected]">'[email protected]</a><!-- e -->' )";
$result = dbquery( $Query, "synapse_entertainment_com" );
echo $result[error];
the following output is printed:
0 0 Commands out of sync; You can't run this command now.
I have never encountered such a thing before, and I am at a loss why the code is producing such an error. Any help would be greatly appreciated. Thanks in advance,
--Andrew M. Dietz
function dbquery( $Query, $subdb )
{
$subdb = "synapse_entertainment_com";
mysql_pconnect( "localhost", "<username>", "<pass"> );
$result = mysql_db_query( $subdb, $Query );
return array(
"result" => $result,
"numrows" => @mysql_num_rows( $result ),
"numfields" => @mysql_num_fields( $result ),
"error" => @mysql_error();
);
}
and the following PHP code is parsed:
$Query = "INSERT INTO test_table ( name, email ) VALUES ( 'moo', <!-- e --><a href="mailto:'[email protected]">'[email protected]</a><!-- e -->' )";
$result = dbquery( $Query, "synapse_entertainment_com" );
echo $result[error];
the following output is printed:
0 0 Commands out of sync; You can't run this command now.
I have never encountered such a thing before, and I am at a loss why the code is producing such an error. Any help would be greatly appreciated. Thanks in advance,
--Andrew M. Dietz