You are here: Re: while ($row = mysql_fetch_array($result)) error suppression « PHP Programming Language « IT news, forums, messages
Re: while ($row = mysql_fetch_array($result)) error suppression

Posted by Chuck Anderson on 09/26/06 02:18

monomaniac21 wrote:
> Hi all!
>
> How can you get rid of the error that displays if you do a query which
> returns no result and then try and fetch the array, WITHOUT having to
> put the while in another conditional like if ($result != ''), something
> more efficient if possible.
>
> regards
>
> Marc
>
>
You can always append the mysql_query with @, but then you're only
hiding a real problem.

Query's that return no results are not erroneous, they do not display an
error message. If you get an error message it means your query was
invalid. echo mysql_error() to find out why.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************

 

Navigation:

[Reply to this 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

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