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 Michael Gross on 12/30/05 02:57

"read" is a reserved word in mysql
(http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html). You have
to double-quote reserved words:

mysql_query("SELECT * FROM mailbox WHERE \"read\"=''");

Graham Cossey wrote:
> On 12/29/05, Jay Blanchard <jay.blanchard@thermon.com> wrote:
>> [snip]
>> could you please tell me what is the problem with this query
>> mysql_query("SELECT * FROM mailbox WHERE read=''");
>>
>> i always get this warning:
>> Warning: mysql_num_rows(): supplied argument is not a valid MySQL
>> result resource in index.php on line 24
>> [/snip]
>>
>> THere is no apparent problem with the query, but there is a problem with
>> mysql_num_rows(). Can you show us he code there?
>>
> I would hazard a guess that mysql_num_rows() is not being passed the
> correct query result handle as a parameter.
>
> ie: $result = mysql_query(...);
> $rows = mysql_num_rows($result);
>
> --
> Graham
>

 

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

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