lovephp Posted November 23, 2012 Share Posted November 23, 2012 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"); } Quote Link to comment https://forums.phpfreaks.com/topic/271075-check-if-name-exist-in-the-table-with-the-id/ Share on other sites More sharing options...
lovephp Posted November 23, 2012 Author Share Posted November 23, 2012 (edited) oops not solved can someone help? Edited November 23, 2012 by lovephp Quote Link to comment https://forums.phpfreaks.com/topic/271075-check-if-name-exist-in-the-table-with-the-id/#findComment-1394617 Share on other sites More sharing options...
lovephp Posted November 23, 2012 Author Share Posted November 23, 2012 lol this time its solved for good Quote Link to comment https://forums.phpfreaks.com/topic/271075-check-if-name-exist-in-the-table-with-the-id/#findComment-1394621 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.