You are here: Re: [PHP] what is the problem with this query? « PHP « IT news, forums, messages
Re: [PHP] what is the problem with this query?

Posted by "Richard Lynch" on 12/30/05 21:23

On Thu, December 29, 2005 7:26 am, sunaram patir wrote:
> could you please tell me what is the problem with this query
> mysql_query("SELECT * FROM mailbox WHERE read=''");

Nope.

Because on the face of it, there is NOTHING wrong with the query
written above, per se.

> i always get this warning:
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL
> result resource in index.php on line 24

While *I* can't tell you what is wrong, and nobody on this entire list
could tell you what is wrong, MySQL and PHP are just BEGGING to tell
you what's wrong:

$result = mysql_query($query) or die(mysql_error());
http://php.net/mysql_error

Actually, there *IS* one obvious thing "wrong" with the query:
You used "SELECT * " and that is a horrible horrible habit to get into.
Don't do it.
Name the columns you actually want.

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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