Call-911 Posted March 30, 2011 Share Posted March 30, 2011 Hello All, I have the following Database Columns: Name, Phone, Email, Keyword What I want to do is store all values in the database based off of the "keyword", so if Row 1 is "John Doe, 123-456-7890, johndoe@yahoo.com, President", then I want to store the following variables: $Presidentname = John Doe $Presidentphone = 123-456-7890 $Presidentemail = johndoe@yahoo.com It seems like it should be easy enough to query a database and assign these variables easily, but I am somehow missing it.... Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/232227-store-query-values-as-variables/ Share on other sites More sharing options...
betterphp Posted March 30, 2011 Share Posted March 30, 2011 mysql_fetch_assoc will return an array containing all of the columns. So you can work directly with those elements. Quote Link to comment https://forums.phpfreaks.com/topic/232227-store-query-values-as-variables/#findComment-1194664 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.