login script
Posted: Wed Oct 24, 2007 10:51 am
hi
im trying to get this login script working:
however when i try logging in it gives me the following error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/public_html/myaccount.php on line 12
Incorrect Login. Try again
does anyone know why this is happening
thanks for any guidance
im trying to get this login script working:
Code: Select all
<?php
session_start();
$fk_memberid=$_POST['fk_memberid'];
$pwd=$_POST['password'];
// now you can check the POST variables for possible code injection...
mysql_connect("localhost", "username", "mypass") or die(mysql_error());
mysql_select_db("mydb") or die(mysql_error());
if (isset($_POST['submit'])) {
$sql="SELECT U_PK, fk_memberid FROM members WHERE fk_memberid='$fk_memberid' AND password='$pwd' ";
if ($row=mysql_fetch_assoc($result)) {
extract($row);
if ($password == $pwd) {
echo "Welcome back, $fk_memberid<br />";
} else {
echo "Incorrect Password. Try again<br />";
}
} else {
echo "Incorrect Login. Try again<br />";
}
}
?>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/public_html/myaccount.php on line 12
Incorrect Login. Try again
does anyone know why this is happening
thanks for any guidance