Services webmasters
Partenaires
Jeux concours gratuits
 
After installing shared MySQL support, Apache dumps core as soon as libphp4.so is loaded. Can this be fixed?
<<<
Why do I get an error that looks something like this: "Warning: 0 is not a MySQL result index in <file> on line <x>" or "Warning: Supplied argument is not a valid MySQL result resource in <file> on line <x>? FAQ : Foire Aux Questions
>>>

10.4 Database issues
10 FAQ : Foire Aux Questions
 Manuel PHP

I heard it's possible to access Microsoft SQL Server from PHP. How?
Can I access Microsoft Access databases?
I upgraded to PHP 4, and now mysql keeps telling me "Warning: MySQL: Unable to save result set in ...". What's up?
PHP 5 no longer bundles
After installing shared MySQL support, Apache dumps core as soon as libphp4.so is loaded. Can this be fixed?
-> Why do I get an error that looks something like this: "Warning: 0 is not a MySQL result index in <file> on line <x>" or "Warning: Supplied argument is not a valid MySQL result resource in <file> on line <x>?

10.4.6 Why do I get an error that looks something like this: "Warning: 0 is not a MySQL result index in <file> on line <x>" or "Warning: Supplied argument is not a valid MySQL result resource in <file> on line <x>?

You are trying to use a result identifier that is 0. The 0 indicates that your query failed for some reason. You need to check for errors after submitting a query and before you attempt to use the returned result identifier. The proper way to do this is with code similar to the following:


$result = mysql_query("SELECT * FROM tables_priv");
if (!$result) {
    echo mysql_error();
    exit;
}
or

$result = mysql_query("SELECT * FROM tables_priv")
    or die("Bad query: ".mysql_error());

<< Why do I get an error that looks something like this: "Warning: 0 is not a MySQL result index in <file> on line <x>" or "Warning: Supplied argument is not a valid MySQL result resource in <file> on line <x>? >>
After installing shared MySQL support, Apache dumps core as soon as libphp4.so is loaded. Can this be fixed? Database issues FAQ : Foire Aux Questions
Services webmasters
Les manuels
 
CoursPHP.com - Reproduction interdite -