I'm having trouble getting something to work.
Is there an reason that array_push would not work with an associative array?
Can you use variables (ie, a mysql_fetch_array array to populate an associative array?
~~
I'm trying to create a single array which consists of the results of two mysql queries; each of which returns two fields .These are ID and NAME, and ID and AKA, respectively, but I'm using AS in the query to change the AKA fieldname to NAME.
I have to combine these results into a single array and then sort them before working with the output.
OK. So I take the results of query1, use mysql-fetch-assoc and a while loop to--I think--convert this result into an associative array:
if (!$new) $new = array();
While ($Row) $new = array_Push($new, "$Row[name]" => "$Row[ID]");
Then I add the results of the second query:
While ($Row2) $new = array_Push($new, "$Row2[name]" => "$Row2[ID]");
I think what I'm doing is creating an empty array and then populating it one row at a time. Is that correct?
However, it's not working.
Can anyone offer suggestions?