need help, Login with role got error
<p>need help, to find what's wrong with my code. i made login with role but the answer is always "your password is wrong". in the logCat it says i need parameter 1 at line 16 on login.php. anyone, please help me. u don;t understand what's wrong.thank oyu</p>

<p>login.php</p>

<pre><code>    &lt;?php
include "config.php";
$uname = $_REQUEST['username'];
$pass = $_REQUEST['password'];
$passhash = md5($pass);
//cek username n password
$dataUser = mysql_query("SELECT * from mdl_user where username='$uname' and password='$passhash'");
$numRow = mysql_num_rows($dataUser);
if ($numRow &gt;= 1)
{
    //kalo username n password benar.
    echo 1;
    $dataUsers = mysql_fetch_assoc($dataUser);
    $idUser = $dataUsers['id'];
    $dataRole = mysql_query("SELECT * from mdl_role_assignment where userid='$idUser' and roleid='5'");
    $numRowRole =  mysql_num_rows($dataRole);  &lt;&lt;&lt;----- this is line 16
    if($numRowRole &gt;= 1)
    {
        //kalo di tabel mdl_role_assignment ada data dengan userid pengguna yg login dan rolenya student
        $dataRoles = mysql_fetch_assoc($dataRole);
        echo 1;
    }
    else
    {
        //kalo di tabel mdl_role_assignment tidak ada data dengan userid pengguna yg login dan rolenya student
        echo 0;
    }
}
else
{   
    //kalo username n password salah.
    echo 0;
} 
?&gt;
</code></pre>

<p>Login.java</p>

<pre><code>    login.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {

                // TODO Auto-generated method stub

                String Re;
                String mUsername = username.getText().toString();
                String mPassword = password.getText().toString();

                Re=tryLogin(mUsername, mPassword);

                Log.d("Check","Here");
                Log.d("Re",Re);
                String temp_check=Re.trim();

                    if(temp_check.equals("1"))
                    {
                         if(temp_check.equals("1"))
                        {
                             String nama = username.getText().toString();
                             Intent newIntent = new Intent(Login.this, MainPage.class);
                             String txtnama = String.valueOf(nama);


                             Bundle bundle = new Bundle();


                             bundle.putString("nama", txtnama);


                             newIntent.putExtras(bundle);
                             startActivityForResult(newIntent, 0);

                        }
                        else
                        {
                            createDialog("sorry", "your role is not student");
                        }
                    }
                    else
                    {
                        createDialog("sorry", "your username or password is wrong !");
                    }
            }

        });

    }
protected String tryLogin(String mUsername, String mPassword)
    {           
      Log.d(" TryLoginCheck ","Here");
        HttpURLConnection connection;
       OutputStreamWriter request = null;

            URL url = null;   
            String response = null;   
            String temp=null;
            String parameters = "username="+mUsername+"&amp;password="+mPassword;   
            System.out.println("UserName"+mUsername+"\n"+"password"+mPassword);
            Log.d("Parameters",parameters);
            try
            {
                ;
                linkurl = new Koneksi(this);
                SERVER_URL = linkurl.getUrl();
                SERVER_URL += "/mobile/Login.php";
                url = new URL(SERVER_URL);
                connection = (HttpURLConnection) url.openConnection();
                connection.setDoOutput(true);
                connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                connection.setRequestMethod("POST");    

                request = new OutputStreamWriter(connection.getOutputStream());
                request.write(parameters);
                request.flush();
                request.close();            
                String line = "";               
                InputStreamReader isr = new InputStreamReader(connection.getInputStream());
                BufferedReader reader = new BufferedReader(isr);
                StringBuilder sb = new StringBuilder();
                while ((line = reader.readLine()) != null)
                {

                    sb.append(line + "\n");
                }
                temp=sb.toString();
                Log.d("Temp",temp);

                response = sb.toString();
                Log.d("Response",response);
               Log.d("Sb Value",sb.toString());
                isr.close();
                reader.close();


            }
            catch(IOException e)
            {
                Toast.makeText(this,e.toString(),Toast.LENGTH_SHORT).show();
            }

            return response;
    }
</code></pre>

<p>LogCat</p>

<pre><code>05-25 13:44:25.945: W/KeyCharacterMap(557): No keyboard for id 0
05-25 13:44:25.945: W/KeyCharacterMap(557): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
05-25 13:44:45.826: D/TryLoginCheck(557): Here
05-25 13:44:45.826: I/System.out(557): UserNametes
05-25 13:44:45.826: I/System.out(557): passwordTes12345*
05-25 13:44:45.836: D/Parameters(557): username=tes&amp;password=Tes12345*
05-25 13:44:46.306: D/Temp(557): 1&lt;br /&gt;
05-25 13:44:46.306: D/Temp(557): &lt;b&gt;Warning&lt;/b&gt;:  mysql_num_rows() expects parameter 1 to be resource, boolean given in &lt;b&gt;C:\xampp\htdocs\mobile\Login.php&lt;/b&gt; on line &lt;b&gt;16&lt;/b&gt;&lt;br /&gt;
05-25 13:44:46.306: D/Temp(557): 0
05-25 13:44:46.316: D/Response(557): 1&lt;br /&gt;
05-25 13:44:46.316: D/Response(557): &lt;b&gt;Warning&lt;/b&gt;:  mysql_num_rows() expects parameter 1 to be resource, boolean given in &lt;b&gt;C:\xampp\htdocs\mobile\Login.php&lt;/b&gt; on line &lt;b&gt;16&lt;/b&gt;&lt;br /&gt;
05-25 13:44:46.316: D/Response(557): 0
05-25 13:44:46.316: D/Sb Value(557): 1&lt;br /&gt;
05-25 13:44:46.316: D/Sb Value(557): &lt;b&gt;Warning&lt;/b&gt;:  mysql_num_rows() expects parameter 1 to be resource, boolean given in &lt;b&gt;C:\xampp\htdocs\mobile\Login.php&lt;/b&gt; on line &lt;b&gt;16&lt;/b&gt;&lt;br /&gt;
05-25 13:44:46.316: D/Sb Value(557): 0
05-25 13:44:46.316: D/Check(557): Here
05-25 13:44:46.316: D/Re(557): 1&lt;br /&gt;
05-25 13:44:46.316: D/Re(557): &lt;b&gt;Warning&lt;/b&gt;:  mysql_num_rows() expects parameter 1 to be resource, boolean given in &lt;b&gt;C:\xampp\htdocs\mobile\Login.php&lt;/b&gt; on line &lt;b&gt;16&lt;/b&gt;&lt;br /&gt;
05-25 13:44:46.316: D/Re(557): 0
</code></pre>
