Reply to Re: Why this doesn't work ?

Your name:

Reply:


Posted by Phillip Oertel on 10/24/05 20:49

hi mario,

first of all, make sure that your query works from the mysql console or
phpmyadmin or some other tool (copy-paste the query from the code and
replace $loging with something reasonable).

then try the following:

$query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";

// check to see if the $login variable has been filled in -
// maybe $login is empty?
echo $query;

$result = mysql_query($query);

if (!$result) {
// mysql will tell you what's wrong
echo mysql_error();
}

mysql_fetch_row($result);

and btw. mysql_fetch_row() doesn't require a connection resource, it
will default to the last opened when none is given.
so you only need to give the 2nd parameter if you have more than one
mysql-db connection open.

regards,
phillip

---

Mário Gamito schrieb:
> Hi,
>
> Why this doesn't work ?
>
> ---
> $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
>
> Any help would be apreciated.
>
> Warm Regards,
> Mário Gamito

[Back to original 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

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