You are here: Re: error using mysql_num_rows( ) « PHP Programming Language « IT news, forums, messages
Re: error using mysql_num_rows( )

Posted by LJB on 11/06/79 11:43

If you do not have a valid resource you will always get an error.

Try catching your resource in an "if" statement.

If($rs) {
do this....
} else {
do something else...
}

If nothing is selected and there are no matching rows you will
not get a valid resource.

Oli Filth wrote:
> Fish44 wrote:
>
>>Ive got the following code which works great on my localserver, but
>>when i upload it to my service provider i get an error
>>
>>"Warning: mysql_num_rows(): supplied argument is not a valid MySQL
>>result resource in /opt2/home3/mitas/public_html/register.php on line
>>86
>
>
> It means it exactly what it says - $rs is not a valid resource, which
> means the line that gives $rs has failed.
>
> echo mysql_error() after every MySQL call, to find out what the problem
> is.
>
>
> P.S. You probably want to put quotes around the e-mail address in the
> query, and also call mysql_real_escape_string() on $eMail.
>

 

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

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