09-10-2009, 05:15 AM
|
#5 (permalink)
|
|
The Acquainted
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
|
Code:
PHP Code:
// Credit should be given to wordpress, I've been studying // their code and came across this, it really is nice. $query = mysql_query('SELECT * FROM entries ORDER BY ID DESC');
foreach ($query as $data) { $results = mysql_fetch_assoc($data);
// Now you should have an associative array // with all of the rows returned from the query. // So, we can just print them out to show you. print_r($results);
}
ERROR:
Warning: Invalid argument supplied for foreach() in C:\wamp\www\pbird\index.php on line 20
line 20 is the foreach statement
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
|
|
|