Afficher un message
Vieux 14/09/2007, 21h38   #2
Andy Hassall
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysql_query($query) returns mysql_errno 0.

On Fri, 14 Sep 2007 19:58:25 -0000, thad.irvin@gmail.com wrote:

>if (!$result);


You have a semicolon here, ending the statement.

> {


This brace is not connected to the previous conditional. Despite PHP not doing
block scoping, it does let you put redundant braces around blocks.

> die ("Query failed. Your Query: " . $query . "
>Returned Error Number: " ." ".mysql_errno() . " Error Detail-> " . m
>ysql_error()). "\n";


So this always runs, $result probably was valid, and mysql_errno tells you "no
there wasn't an error".

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
  Réponse avec citation
 
Page generated in 0,04636 seconds with 9 queries