Hi,
I am new to php and I am having trouble with a php login code for website I am making. I am getting a response saying "notice undefined variable row"
this is what I have thus far: How would I define that row?
<?php
$db_usr= $_POST["userid"];
$db_pswd= $_POST["password"];
$con=mysql_connect("localhost",$db_user,$db_pass, $db_name);
if(! $con)
{
die('Connection Failed'.mysql_error());
}
mysql_select_db("*****",$con);
$sql=mysql_query("SELECT * FROM users WHERE userid='name' and password='password'");
$result=mysql_query($sql);
{
if($row["userid"]==$db_usr && $row["password"]==$db_pswd)
echo "Welcome Back $db_usr ";
else
echo "Sorry $db_usr";
}
?>