Kayz Posted April 7, 2007 Share Posted April 7, 2007 Ok i am having a problem with the sessions been working on it for a good 4 hours still no luck. Ok the code below connects to the database fine, <?php session_start(); $connect = mysql_connect("*******ac.uk","******","******"); mysql_select_db("mdb_*****", $connect); $date = date("Y-m-d"); $query = "SELECT * contacts values('$firstname', '$surname', '$email', '$contact_no', '$housename_no', '$address_line1', '$address_line2', '$address_line3','$city_county','$postcode','$username', '$password', '$date')"; mysql_query ($query, $connect); ?> Later on in the page a bit further down once the user logs in i want to show his/her username. So this is what i have done: <strong>Welcome</strong> <?php echo $username ?> This works perfectly fine showing the username that has logged in, but then ive tried to call up many other details about that particular user but no luck. Ive tried echo $email etc. But the funny thing is if i try echo $username or echo $password it will show also if i try echo $date that shows also, only these 3 things show nothing else. What can i do? I just want to show that user his/her own details that is stored in the MySQL db. Link to comment https://forums.phpfreaks.com/topic/46037-session-help/ Share on other sites More sharing options...
redking Posted April 7, 2007 Share Posted April 7, 2007 What are you trying to do with that $query? Is is supposed to get data from the database or put data into it? Link to comment https://forums.phpfreaks.com/topic/46037-session-help/#findComment-223698 Share on other sites More sharing options...
Kayz Posted April 7, 2007 Author Share Posted April 7, 2007 What are you trying to do with that $query? Is is supposed to get data from the database or put data into it? A very good point, it is suppose to get data. Do i change it to $sql? Link to comment https://forums.phpfreaks.com/topic/46037-session-help/#findComment-223704 Share on other sites More sharing options...
Kayz Posted April 7, 2007 Author Share Posted April 7, 2007 *bump* anybody maybe clarify it for me? This forum is faast! Link to comment https://forums.phpfreaks.com/topic/46037-session-help/#findComment-223824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.