Page 1 of 1

GetAssoc() ADODB Question:

Posted: Fri Jun 03, 2005 9:50 am
by neophyte
I'm using GetAssoc() to return data. This is how it is currently returning:

Code: Select all

ї178]=> //THIS IS THE PROBLEM
  array(11) {
    ї&quote;id&quote;]=>
    string(3) &quote;178&quote;
    ї0]=>
    string(29) &quote;Aesthetics and Visual Culture&quote;
    ї&quote;res_name&quote;]=>
    string(29) &quote;Aesthetics and Visual Culture&quote;
    ї1]=>
    string(45) &quote;http://pegasus.cc.ucf.edu/~janzb/aesthetics/
&quote;
    ї&quote;res_url&quote;]=>
    string(45) &quote;http://pegasus.cc.ucf.edu/~janzb/aesthetics/
&quote;
    ї2]=>
    string(7) &quote;8388607&quote;
    ї&quote;res_time&quote;]=>
    string(7) &quote;8388607&quote;
    ї3]=>
    string(3) &quote;178&quote;
    ї&quote;resource_id&quote;]=>
    string(3) &quote;178&quote;
    ї4]=>
    string(1) &quote;5&quote;
    ї&quote;category_id&quote;]=>
    string(1) &quote;5&quote;
  }
As you can see the index starts at 178. Is there a way to force GetAssoc() to start at 0 instead of using the first column of the db to order the array?

Here's the code I'm currently using.

Code: Select all

$resource = $db -> GetAssoc($sql);

Posted: Fri Jun 03, 2005 10:20 am
by Syranide
if there is no FLAG in the manual, you better just write your own function to reindex it, even though I don't see why, you rarely use the index anyway?

Posted: Fri Jun 03, 2005 10:23 am
by neophyte
Thanks for the tip... I didnt' see anything in the manual either.