jassikundi Posted February 15, 2008 Share Posted February 15, 2008 Hi everyone, I'm trying to retrieve data from my mysql database using php. I've got a table called completed_quote and would like to retrieve data from the columns (username, postcode, and completedquote) for a specific person who is logged into view the page. I'm currently using $username to retrieve the username of the person from the session. What modifications would need to be made to the php code below that retrieves the entire data from a table. [pre]//Retrieves data from MySQL $data = mysql_query("SELECT * FROM completed_quote") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data ))[/pre] Regards Jassi Quote Link to comment Share on other sites More sharing options...
craygo Posted February 15, 2008 Share Posted February 15, 2008 $data = mysql_query("SELECT * FROM completed_quote WHERE username = '$username'") or die(mysql_error()); Ray Quote Link to comment Share on other sites More sharing options...
jassikundi Posted February 15, 2008 Author Share Posted February 15, 2008 Thankyou Craygo for the quick reply tested and working thankyou. Quote Link to comment Share on other sites More sharing options...
craygo Posted February 15, 2008 Share Posted February 15, 2008 Anytime, don't forget the solved button. Ray Quote Link to comment 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.