Re: query works in phpmyadmin but not from my code
Posted: Sun Mar 28, 2010 5:50 pm
Ok, I found the problem. I never use OR and didn't realize it could affect return values.
Change
To
[text]root@midnight:# php -r 'echo var_dump(4 OR false);'
bool(true)
[/text]
Change
Code: Select all
function SendQ($query)
{
return mysql_query($query) or die(mysql_error());
}Code: Select all
function SendQ($query) {
$result = mysql_query($query);
if (!$result) die(mysql_error());
return $result;
}bool(true)
[/text]