Log in

View Full Version : Mysql display multiple rows.



Decode
20-06-2008, 05:35 PM
Ive got this far:



$query = mysql_query("SELECT * FROM pm WHERE sendto = '$usernameid' LIMIT 0 , 30");

$query = mysql_query("$query");

while($row = mysql_fetch_array($query)) {
echo "<a href=\"pm.php?viewpm=" . $row['id'] . "\">" . $row['subject'] . "</a>";
}
Its ment to list the first 30 PMs that the user has got. But i get this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp2\www\entertain-me\pm.php on line 34

I cant figure out why its not working :S

EDIT: fixed :P I just realised i have queried the sql twice :)

Invent
25-07-2008, 10:58 AM
Hi,

Good to hear you've managed to fix the issue!

Thanks,
Invent

Want to hide these adverts? Register an account for free!