Vivid Lust Posted January 29, 2010 Share Posted January 29, 2010 Hi, with php, how do i get a value that i am trying to get, from a mysql database if the sql is: SELECT email FROM members WHERE username = username $email = thanks! Quote Link to comment Share on other sites More sharing options...
akitchin Posted January 29, 2010 Share Posted January 29, 2010 you need to use some or all of the following functions: mysql_connect mysql_select_db mysql_query mysql_fetch_array mysql_result there are also a number of tutorials if you simply google the phrase "using mysql with php". Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted January 29, 2010 Author Share Posted January 29, 2010 Do i still use mysql_fetch_array() in a while loop if i only want to get one value? Quote Link to comment Share on other sites More sharing options...
akitchin Posted January 29, 2010 Share Posted January 29, 2010 no, there's no need - you can just assign the return value from mysql_fetch_array() to a variable. that will give you an array, so you'll need to specify the column as the array's index: echo $variable['column_name']; 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.