always this > Warning: mysql_fetch_array(): supplied argument is not valid MySQL

i have this error all the time and i dont get it, it always shows up and only works after tinkering with it and i forget what i did.

here is my query and the table

[php]<?php
$sql=“SELECT * FROM messages ORDER BY ID DESC”;
$result = mysql_query($sql);
while($row=mysql_fetch_array($result)){
?>

<?php echo $row['naam']; ?> <?php echo $row['date']; ?>
<?php echo $row['message']; ?>
<?php } ?>[/php]

hope you guys can help me again :slight_smile:

try using this

[php]
$result = mysql_query($sql) or die(mysql_error());
[/php]
now tell me what is the error

oow jezus what a big fail, i forgot to select a database -.-’

I know it happens that why i love programming

in the future always you or die so you know where your script stops working

was al little too confident with myself :slight_smile:

haha that is nice but in programming it can save you time

yeah thats true

Sponsor our Newsletter | Privacy Policy | Terms of Service