applebiz89 Posted November 13, 2009 Share Posted November 13, 2009 hey, I have two tables in my mySQL database: login and musicians(which is basically members of the site) the sign up information goes to the musicians table and, when a member logs into the site their session goes into the login table with their sessionID,username,ip and time they logged in. My problem is that once they have logged in, they get directed to their 'profile' page so they can view the information they inserted into the sign up form. How can I collect the information that is this users; so it queries the database by the username that is in the sessionID and gathers the information held in the musicians table, if that makes sense... if there is any other way you can suggest or help that would be great. Just trying to get my head round it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/181385-help-with-select-statement/ Share on other sites More sharing options...
Mchl Posted November 13, 2009 Share Posted November 13, 2009 It would be helpful if you posted your table structure, and also an example of what you want to retrieve basing on what. Quote Link to comment https://forums.phpfreaks.com/topic/181385-help-with-select-statement/#findComment-956832 Share on other sites More sharing options...
applebiz89 Posted November 13, 2009 Author Share Posted November 13, 2009 This is taken direct from phpMyadmin so sorry for format. but should get the Jist firstname varchar(25) latin1_general_ci Yes NULL lastname varchar(25) latin1_general_ci Yes NULL DOB date Yes NULL username varchar(50) latin1_general_ci No None password char(32) latin1_general_ci No None instrument varchar(25) latin1_general_ci Yes NULL location varchar(25) latin1_general_ci Yes NULL postcode varchar( latin1_general_ci No None genre varchar(25) latin1_general_ci Yes NULL aboutsection text latin1_general_ci Yes NULL picture blob BINARY Yes NULL Field Type Collation Attributes Null Default Extra Action id varchar(50) latin1_general_ci No username varchar(10 )latin1_general_ci No ip varchar(20) latin1_general_ci No tm datetime No 0000-00-00 00:00:00 status char(3) latin1_general_ci No ON Anyways I realised how to do this by using this statement: SELECT * FROM musicians WHERE username='$_SESSION[username]'; and then putting this into an array and echoing each attribute... but one question. is there anyway of putting this into a nice 'profile' sort of format. So can I just use the 'echo "<td>" . $row['username'] . "</td>";' code in perhaps a table structure.. Quote Link to comment https://forums.phpfreaks.com/topic/181385-help-with-select-statement/#findComment-956837 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.