Jump to content

Check If Name Exist In The Table With The Id?


lovephp

Recommended Posts

how do i check if if the name in session $name = $login->username; exist in the table with requested id? below is something that i am trying to get but nothing happening

 

$id =$_REQUEST['id'];    
$name = $login->username;
$result = mysql_query("SELECT name FROM table WHERE id  = '$id'");
$auth = mysql_fetch_array($result);
if($auth = 1){
echo 'this is valid';
}else:{
lheader("Location: logout.php");
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.