Re: Why this doesn't work ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux