quick question... my sql query is spitting out this data...
Array ( [id] => 1 [name] => Test Name [text] => This is text [image] => image.jpg )
mysql_fetch_assoc
fetches one row at a time. You need to loop over the result set:
while(false !== ($row = mysql_fetch_assoc($results))){
[handle $row here]
}
From the docs (search is your friend):
Returns an associative array of strings that corresponds to the fetched row, or FALSE if there are no more rows.
If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using mysql_fetch_row() or add alias names. See the example at the mysql_fetch_array() description about aliases.
Cheers
mysql_fetch_assoc($results) does only fetches one row.
http://php.net/manual/en/function.mysql-fetch-assoc.php
The fetch functions only return a single row at a time. If you want all the rows, you'll have to use a loop:
while($row = mysql_fetch_assoc($results)) {
... do stuff with $row
}