
April 24th, 2000, 07:46 PM
|
|
Contributing User
|
|
Join Date: Feb 2000
Posts: 43
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
I cannot figure out what I am doing wrong... I am trying to create a "register" page for my site where the user fills in his desired username, real name, password, and his email address... for my example I will be passing $username and $email from a previous form..
register.php3
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
$query1 = "SELECT username FROM tblusers WHERE username='$username'";
$query2 = "SELECT email FROM tblusers WHERE email='$email'";
//
// here's the problem part
//
$user_prev_a = MYSQL_QUERY($query1);
if ($user_prev = MYSQL_FETCH_ARRAY($user_prev_a)) {
$userexists = 1;
}
$email_prev_a = MYSQL_QUERY($query2);
if ($email_prev = MYSQL_FETCH_ARRAY($email_prev_a)) {
$emailexists = 1;
}
[/code]
What I'm trying to do is say "Query for the provided username, if it exists in the database, then set $userexists to 1", but what I am getting is the following error :
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
Warning: 0 is not a MySQL result index in /www/yoursite/register.php3 on line 84
Warning: 0 is not a MySQL result index in /www/yoursite/register.php3 on line 91
[/code]
Any help on how to accomplish this would be greatly appreciated.
Mike
|