simple SELECT FROM query
Status: Interested
Joined: 28 Jun 2009
Posts: 12
Reply Quote
Could someone help with a simple MySQL request. I seem to be having trouble selecting from more than one field in the same table.

TABLE: User Data
username | password


$result = mysql_query ("SELECT `username` FROM `User Data`")
or die(mysql_error());

$row = mysql_fetch_row($result); // converts the result into an array


echo $row[0] ;

This snip of code works fine to return one value but I want to select the 'username' and 'password' columns FROM 'user data' WHERE 'username' = '$username' AND 'password' = '$password'

... in one query.

the $username $password variables are delivered via query string.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours