Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
<p>hi i am new to php and now i having problem with login</p>

<ol>
<li>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in...</li>
<li>Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in....</li>
</ol>

<blockquote>
  <p>coding php:</p>

<pre><code> &lt;?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');
}
</code></pre>
</blockquote>
