ben.matthews18 Posted May 20, 2010 Share Posted May 20, 2010 Ok here is the situatation, I have three tables set up; 'Users' 'Profile' 'Linkingtbl' The 'Users' table holds the following data; Email (PK) Password The 'Profile' table holds the following data; ProfileID (PK) Firstname Lastname DOB The 'Linkingtbl' table holds the following data; ID (PK) Email (FK) Password ProfileID (FK) I have a login system setup and want to be able to show the users 'ProfileID'. The problem that I have is that I also have a select system setup and it is just selecting the first 'ProfileID' in the table and not the 'ProfileID' that is related to the user. How can I do this? Do I need to use a 'WHERE' statement? Thanks Link to comment https://forums.phpfreaks.com/topic/202398-getting-user-data-once-logged-in/ Share on other sites More sharing options...
-Karl- Posted May 20, 2010 Share Posted May 20, 2010 $username = $_SESSION['username']; mysql_query("SELECT * FROM tablename WHERE username = '$username'; Something like that would work fine. Link to comment https://forums.phpfreaks.com/topic/202398-getting-user-data-once-logged-in/#findComment-1061190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.