kamitai Posted July 12, 2007 Share Posted July 12, 2007 First, thanks for reading this. I will try to explain as best as I can what Im trying to do with php & mysql. I have a table set up with lots of information I would like to display for a particular user, after they've logged in. I have a table that has columns with various info such as name, address, user, pass, among others. I have rows that have this specific information. I would like a simple log in that would take the user name and password entered and compare it to all the rows to find a record that matched both, then output this for that particular user. Is this the most simple way to go about it? Is there a better method? Still very new, and would appreciate any ideas or suggestions. Could I add like a filter of somesort the the fetch below? $sql = "SELECT name, email FROM people_table"; $query = mysql_query($sql); while($row = mysql_fetch_assoc($query)){ echo $row['name'].'<br />'; echo $row['email'].'<br />'; Anyhoo , Thanks again Quote Link to comment Share on other sites More sharing options...
per1os Posted July 12, 2007 Share Posted July 12, 2007 $sql = "SELECT name, email FROM people_table username = '" . $username . "' AND password = '" . $password . "'"; 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.