Forum Moderators: coopster
I have a function that uses and array in the following format.
$cat = array("1"=>"All","2"=>"red","3"=>"yellow","4"=>"green");
I have those recpective values in a db and can get them out easily with a query.
$sql = mysql_query("SELECT id, colour FROM category_two");
$test = mysql_fetch_array($sql, mysql_ASSOC);
But converting them into the above format is not hapening. All I get is one value. Can I not just grab the whole array in one go or do I need to build it up with some sort of while statement?
It has always confused me this array stuff :(
Does the above make sense.