PHP MySQL Display Table Data Help?
|
demo 24 Dec 2008 11:20pm I have a table named "user_data" where certain information about the users is kept. I need a way, after the user has logged in, to display ONLY the information pertaining to that specific user, in a table, without any other user’s info. I already have the registration and login scripts, I just need the display script. Any ideas on how to do this? |
Answers
|
demo 24 Dec 2008 11:44pm So...you want the user's to be able to see their own information? Tell PHP, when it does a MySQL query to search the table but only take row values where the user name is involved. e.g. Bob logs in $query='select * from user_data where last_name = "Bob" '; Of course..you'll probably have more than one Bob but you get the idea. You can do searches to identify them by their unique ID or whatever you want. |
|
demo 25 Dec 2008 12:52am $myDB = new mysqli('localhost', 'root', 'password', 'user_data'); $statement_ = "SELECT * FROM user_data WHERE specific_user=".$UniqueUser; $res = $myDB->query($statement); // ... etc.. etc.. The first answer is absolutely correct. This answer will serve as your alternative guide and example. * remember that $UniqueUser is a variable and contains value of the specific user.. |
Related
Submit Answer
You must be logged in to post an answer. Please Login or Register.
Powered by phpMyAnswers.