Forum Moderators: coopster
When using PHP/MySQL to check a username and password in a database, I get this error message:
Unknown column 'username' in 'where clause'
Here is my code:
<?php
$sql = "select * from members where user=$user and pw=$pw";
$result = mysql_query($sql) or die(mysql_error());
$num = mysql_nuw_rows($result);
echo $num;
if($num <= 0 )
{
echo 'There is noone in the database with that name and password';
}
else
{echo 'The username and password match';}
?>
Any suggestions?