Reply to Re: mysql_query($query) returns mysql_errno 0.

Your name:

Reply:


Posted by Andy Hassall on 09/14/07 20:38

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация