When I build a query and run a Pear DB call to 'getAssoc($sql)' I get back an array with numeric keys to the array.
array ( [0]=>"result1", [1]=>"result2", [2]=>"result3" )
What I had expected was:
array ( ["field1"]=>"result1", ["field2"]=>"result2", ["field3"]=>"result3" )
I wanted to shortcut the process of:
$res=$dbh->query($sql)
while ($row=$res->fetchRow(DB_FETCHMODE_ASSOC)) {
$array[]=$row;
}
What am I missing?! Thx. D.
Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
array ( [0]=>"result1", [1]=>"result2", [2]=>"result3" )
What I had expected was:
array ( ["field1"]=>"result1", ["field2"]=>"result2", ["field3"]=>"result3" )
I wanted to shortcut the process of:
$res=$dbh->query($sql)
while ($row=$res->fetchRow(DB_FETCHMODE_ASSOC)) {
$array[]=$row;
}
What am I missing?! Thx. D.
Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.