RE: MySQL verify
| From: | Ted Knudson | Date: | Thu, 25 May 2000 01:11:26 +0000 |
| Subject: | RE: MySQL verify | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-83@lists.php.net to get a copy of this message | ||
Put an @ in front of mysql_query: @mysql_query
Ted Knudson
http://www.automatedcabinets.com
http://www.pulsarusa.com
> -----Original Message-----
> From: Richard Simard [mailto:richard@sagnet.qc.ca]
> Sent: Wednesday, May 24, 2000 5:49 PM
> To: php-db@lists.php.net
> Subject: MySQL verify
>
>
> I Want QUERY the DB for look if $nick alredy existe in TABLE usagers
> If this nick existe send message 1
> but if dont existe send message 2
>
> Presentely i use this but I recive this error when the nick dont existe:
> ***Warning: Unable to jump to row 0 on MySQL result index 2 in
> ***/vhome/sherbrooke.sagnet.qc.ca/home/httpd/html/add.php3 on line 78
>
> And the message 2 is displayed
>
> But if the nick alredy existe, i recive no error ans message 1 is
> displayed.
>
> Where is my error???
>
> PS: This script is online at:
> http://www.sherbrooke.sagnet.qc.ca/les_usagers_reguliers.html
> on click to
> Ajoutez-vous a la liste
>
>
> $db =
> mysql_connect("server.sagnet.qc.ca","user_name","password");
> mysql_select_db("sherbrooke",$db);
>
> $verify = mysql_query("SELECT * FROM usagers WHERE nick = '$nick'",$db);
>
>
> if (mysql_result($verify,0,"nick")) {
>
> echo "<HTML>\n<HEAD>\n<TITLE> ...
>
> ... }
>
> else {
> echo "<HTML>\n<HEAD>\n<TITLE> ...
>
> ... }
>
>
> Richard Simard
>
>