Dsnowdon Posted May 24, 2010 Share Posted May 24, 2010 ok i have make this file its called admin_menu.php.inc <?php require_once('../auth.php'); require('connet.php') $user_id = $_SESSION['SESS_MEMBER_ID']; $query = "SELECT * FROM `members` WHERE user_id = '$user_id'"; $resultm = mysql_query($query); $user = mysql_fetch_assoc($resultm); echo "Hello {$user['firstname']}:<br /><br />\n"; //Only display link four for users of level 1 if($user['level']=='1') { echo "<a href="#">Link 4</a><br />\n"; } ?> i am going to include that file on my dream wever template but it dont work for some reson can some one help me please thanks dale Link to comment https://forums.phpfreaks.com/topic/202753-php-mysql-help/ Share on other sites More sharing options...
andrewgauger Posted May 24, 2010 Share Posted May 24, 2010 Everything there looks good. What part of it doesn't work? Are you getting an error message? If not, put a ini_set('display_errors',1); at the top. If it isn't an error, try print_r($user); to make sure you have all the data you were expecting. Do you have: session_start(); somewhere? etc, etc. Link to comment https://forums.phpfreaks.com/topic/202753-php-mysql-help/#findComment-1062769 Share on other sites More sharing options...
Bladescope Posted May 24, 2010 Share Posted May 24, 2010 Andrew is correct, you're calling SESSION variables without starting the session first. session_start(); should be at the top of the page, just below the opening php tag. Link to comment https://forums.phpfreaks.com/topic/202753-php-mysql-help/#findComment-1062797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.