views:

24

answers:

2

I have one table ( members ) and five columns ( username , password , FirstName , LastName , Email )

I need to get the Email for the user admin. How would this be done?

+1  A: 
SELECT Email FROM members WHERE username = 'admin';
Zurahn
Ok. I think this is working, but how would I display the address on the page?
Zachary Brown
You have to execute the query and assign the result to a variable. There are the `mysql_query` set of functions, but the best option is to use `PDO`. This is an excellent resource: http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html
Zurahn
A: 

Do you know what the username is of the admin? If so you can do the following:

SELECT `Email`
FROM `members`
WHERE `username` = {$username}
Aaron Hathaway