Forum Moderators: coopster
[2]
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/imperial/public_html/fire/html/forgot_password_fns.php on line 11Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/imperial/public_html/fire/html/forgot_password_fns.php on line 12
The username you entered does not exist in our database, please go back and try again.[/2]
my code:
[2]
include("db_fns.php");
$username = $_POST['username'];
if($username == "") {
echo "You have not entered a username, so please go back and enter one.";
exit;
}
$check = "SELECT * FROM members WHERE name = '$username'";
$exist = mysql_query($check, $dbconn); // line 11
if(mysql_num_rows($exist) == 0) { // line 12
echo "The username you entered does not exist in our database, please go back and try again.";
exit;
}[/2]
It is just a simple forgot password script.. I don't see the problem.. maybe someone else can.
2 - is the table called "members" and is the field called "name" (check it's not actually "username" or something... common mistake)
3 - add after line 10 the code:
echo $check;
The error is NOT with line 12, it is 11 or before.
Try adding this after the include:
mysql_select_db($dbconn) or die("Could not select database"); and change this:
$exist = mysql_query($check, $dbconn); to this:
$exist = mysql_query($check);