Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Help with SQL query and associative array
April 9, 2006, 10:13 pm
rate this thread
it to print out just fine on screen, but I can't figure out how to get
the data into an associative array. I have been playing with this for
the past few days and cannot get over the hump on this one.
Can someone please help?
The reason i need to get this data into an associative array is because
the data represents a report I need to export into Excel via the
Any help would be much appreciated. I need to get this done for my boss
Re: Help with SQL query and associative array
Which database do you use?
Or do you use an abstractionlayer maybe?
The right answer depends on your circumstances.
If you use ADODB, try:
$RS = $conn->Execute($someSQL)->getArray();
to make the $RS an assoc array.
(I always do this because it makes the use of the $RS so much more
If you use ADODB be sure you set the connection-object first in assoc mode,
with something like:
So just look up the corresponding command for you database at www.php.net.