stuart7398 Posted April 8, 2008 Share Posted April 8, 2008 Hi. I have a members area. When the member logs in, they see links to their respective pages – 'My Profile', and so on. I want the user to view their own personal profile / space / settings taken from the database. What do I use to achieve this? Thanks, Stuart. <?php require_once('auth.php'); ?> <?php $page_title = 'My Profile'; @ require_once ('../includes/head.php'); ?> <div class="members_nav"><a href=" member-homepage.php">My Homepage</a> | <a href=" member-profile.php">My Profile</a> | <a href=" member-pictures.php">My Pictures</a> | <a href=" logout.php">Logout</a></div> <?php require '../conn/config.php'; require '../conn/opendb.php'; $data = mysql_query("SELECT * FROM `members` ORDER BY member_id") OR DIE (mysql_error()); $info = mysql_fetch_array( $data ); { Print "<p><br /><h1>Welcome Back ".$info['firstname']."</h1></p>"; } ?> </div></div> <?php @ require_once ('../includes/leftnav.php'); @ require_once ('../ includes /rightnav.php'); @ require_once ('../ includes /foot.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/ Share on other sites More sharing options...
fenway Posted April 8, 2008 Share Posted April 8, 2008 Um, no where clause? Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/#findComment-512031 Share on other sites More sharing options...
stuart7398 Posted April 8, 2008 Author Share Posted April 8, 2008 Hi. An example would be appreciated. the code presented is for someone already logged in. thanks. stuart. Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/#findComment-512034 Share on other sites More sharing options...
fenway Posted April 8, 2008 Share Posted April 8, 2008 An example would be appreciated. the code presented is for someone already logged in. Then where is the member ID in your SQL query? Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/#findComment-512038 Share on other sites More sharing options...
stuart7398 Posted April 8, 2008 Author Share Posted April 8, 2008 Im honestly not sure. I've been learning only for about 12 weeks. Any help appreciated. thanks. WHERE added below <?php require '../connect/config.php'; require '../connect/opendb.php'; $data = mysql_query("SELECT * FROM members WHERE member_id = '$id'") OR DIE (mysql_error()); $info = mysql_fetch_array( $data ); { Print "<p><br /><h1>Welcome Back ".$info['firstname']."</h1></p>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/#findComment-512042 Share on other sites More sharing options...
stuart7398 Posted April 8, 2008 Author Share Posted April 8, 2008 I think I have the WHERE but how do i identify the user who is logged in SELECT * FROM members WHERE '?????' = '????' " thanks, Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/#findComment-512056 Share on other sites More sharing options...
stuart7398 Posted April 8, 2008 Author Share Posted April 8, 2008 Thanks. The WHERE was the key. Stu. Quote Link to comment https://forums.phpfreaks.com/topic/100143-solved-how-do-i-extract-data-from-the-members-only-section/#findComment-512063 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.