array woes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I have some array code driving me nuts.

I am pulling from a db:

select id, vehicle, has_quotes from cars where active=1

I then loop through these and build an array that contains the id's and cars.

while($res){

$cars[$res[id]]=$res[vehicle];
//here is the problem, when has_quotes is 1, I call another function
to grab the quotes
   if ($res[has_quotes]>1){
    $cars[$res[id]]=grabQuotes($res[id]);
   }

}

The grabQuotes function returns an array and works fine.  THe problem
is when I go to display these, I cycle through the car array printing
id and vehicle name.  I do a check so if vehicle name is an array, I
print out the quotes from the inner array, problem is I have lost the
vehicle name!  How can I fix this?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux