I am trying to select data from a MySQL table, but I get one of the following error messages:
mysql_fetch_array() expects parameter 1 to be resource,
Try this code it work fine
assign the post variable to the variable
$username = $_POST['uname']; $password = $_POST['pass']; $result = mysql_query('SELECT * FROM userData WHERE UserName LIKE $username'); if(!empty($result)){ while($row = mysql_fetch_array($result)){ echo $row['FirstName']; } }