Page 1 of 1

MySQL row['values'] to variables?

Posted: Wed Oct 15, 2008 7:05 pm
by anebg
I have this huge database and i was wondering if there was a way that I could make all the values "in the fetched array" as real variables without having to declare every single one.
$title=$row['title'];
$name=$row['name'];
Is there a way php can do it for me? using foreach? maybe for?
This is a pain
:banghead:
but cheers fellow programmers :drunk:

Re: MySQL row['values'] to variables?

Posted: Wed Oct 15, 2008 7:18 pm
by requinix
extract($row)
Make sure you specify the fields in your query, no wildcards.

Re: MySQL row['values'] to variables?

Posted: Wed Oct 15, 2008 7:20 pm
by anebg
Sweet. Thank You for your adequate and prompt response!
:drunk: