MySQL verify
| From: | Richard Simard | Date: | Wed, 24 May 2000 22:49:20 +0000 |
| Subject: | MySQL verify | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-79@lists.php.net to get a copy of this message | ||
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