I'm making a login page for my site and i am having some problems with 2 things in it atm.
First of all this part of the code
Code: Select all
$database = mysql_select_db("$db");
$sql = "SELECT * FROM authadmin";
$result = mysql_query("$sql");
while($row = mysql_fetch_row($result))
if($_POST['user'] == $row[0] && $_POST['pass'] == $row[1])
Code: Select all
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\Program\wamp\www\documentcat\adm\login.php on line 12
and i have one other small problem, i have an error that is shown when the login/pass fields are empty on the page, but i don't want it to be shown when first entering the page, any ideas?
Thanks in advance
PS: This post was fucking awful to make thanks to the PHP-NUKE tag filter.
EDIT: solved it, i was way off ^^
Code: Select all
$sql = mysql_query("SELECT * FROM authadmin WHERE user='".$username."'");