SQL in PHP - mysql_fetch_array() ...Whats wrong with this code.....?

BEnno

New member
Hi i have a little script that gets headlines from an sql table, loops through and displays them one after the other. Anyway the first time i call it works greats but if i call it a second time i get errors.

So whats wrong with this code thats not allowing me to call it a second time.....
_________________________________________________________

// Get news items from database, and order them from newest to oldest
if($c != "") { $t_news .= " WHERE cat = '$c'"; }

$q['info'] = mysql_query("SELECT * FROM $t_news ORDER BY date DESC LIMIT 0, $lim", $link);

while($h = mysql_fetch_array($q['info'], MYSQL_ASSOC)) {
// do what ever in here
}
____________________________________________________________

THE ERROR: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in blah blah

IM certain that i have to reset something but its causing me so much hassle.
 
Back
Top