diode Posted November 10, 2006 Share Posted November 10, 2006 Ok I am progressing alright in php.I thought I almost had it when I hit a wall. I have two new problems:1) I suddenly realized that I need to query a table and place the values in the fields that are in the table into variablesAnd 2) I want the person's username/time msg was posted/ and other misc stuff on the top line of a post, and the message body on the second line of a user's post. But how in the world would I pick out certain data and put it in its own row?I have looked all over the web for tutorials and other faqs but I not sure on what I need to look for in order for these to work.As always, thanks in advance :),diode Link to comment https://forums.phpfreaks.com/topic/26794-assigning-values-from-table-queries-to-variables/ Share on other sites More sharing options...
joshi_v Posted November 10, 2006 Share Posted November 10, 2006 Well! Your first problem is to assign the contents of db to other variables!See this one..[code]$sql="select one,two from table_name [where_caluse] ";$qry=mysql_query($sql) or die (mysql_error()); # here i am assuming that you had only one row.$result=mysql_fetch_array($qry);$var_one=$result['one'];$var_two=$result['two'];[/code]First let us know this is the same you want for the first problem or not.If it is not i would like to know little more description about your problem.RegardsJoshi. Link to comment https://forums.phpfreaks.com/topic/26794-assigning-values-from-table-queries-to-variables/#findComment-122541 Share on other sites More sharing options...
diode Posted November 10, 2006 Author Share Posted November 10, 2006 Oh! So you recommend typing out all the fields instead of just * (all)? That would make sense lol.That might work. It's late now so I have to go to bed I'll try it in about 20 hours when I am off work lol.Thanks for your quick response :Ddiode Link to comment https://forums.phpfreaks.com/topic/26794-assigning-values-from-table-queries-to-variables/#findComment-122544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.