[Solved] Getting a Row in PHP [closed]


Remember, that mysql_query returns query resource handler, not result.

You must call mysql_fetch_assoc($queryResource) to get the results.

In your example:

//-select the database to use
$mydb=mysql_select_db("TABLE");

//-query the database table
$sql="select * from Contacts where `Email`= '$email_user'";

//-run the query against the mysql query function
$queryResource=mysql_query($sql);
$result = mysql_fetch_assoc($queryResource);

if ($result){
    echo "Hello your ID is ". $result['Id'];
}
else{
    echo "Sorry we could find that user";
}

solved Getting a Row in PHP [closed]