i've problem with login, if login always appear error
1.Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in....
2.Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in....
coding php:
<?php
include ("config/koneksi.php");
include ("config/library.php");
$pass = md5($_POST['password']);
$login = mysql_query("SELECT * FROM user WHERE id_user='$_POST[username]' AND sesi='$pass'");
$found = mysql_num_rows($login); /////error
$r = mysql_fetch_array($login); /////error
if ($r){
session_start();
session_register("username");
session_register("sesi");
session_register("role");
$_SESSION[username] = $r[id_user];
$_SESSION[sesi] = $r[sesi];
$_SESSION[role]= $r[role];
header ('location:home.php');
}
else{
//echo "<link href=../config/adminstyle.css rel=stylesheet type=text/css>";
echo "<center>login failed! username & password not right<br>
<a href=index.htm><b>ULANGI LAGI</b></a></center>";
}
?>
please solution...