You are here: Re: [PHP] Why this doesn't work ? « PHP « IT news, forums, messages
Re: [PHP] Why this doesn't work ?

Posted by "Richard Lynch" on 10/25/05 05:32

On Mon, October 24, 2005 12:25 pm, Mário Gamito wrote:
> ---
> $query = "SELECT COUNT (login) FROM WHERE login = '$login'";
> $result = mysql_query($query);
> mysql_fetch_row($result);
> ---
>
> It gives me
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
> result resource in /var/www/html/registar_action.php on line 22

First, I'm going to give you a fish:
.... FROM WHERE ...
Which MySQL database TABLE is it that you think you are looking in?
You have to tell it which table to look in.

Now I'm gonna teach you to catch fish:
Change your middle line to:
$result = mysql_query($query) or die("<br />$query<br />" .
mysql_error());

That will get PHP and MySQL to TELL YOU what's wrong, instead of just
saying "Something's wrong"

--
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

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