crays
06-10-2008, 02:45 PM
Hi, i'm trying to loop my news section until the condition is met. But the code tells me
mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ...
here is my code:
<?php
//connected to the db
$result = mysql_query("SELECT TOP 5 * FROM news ORDER BY ID DESC");
while ($row = mysql_fetch_assoc($result))
{
?>
<table>
Title : <?php echo $row['title'] ?>
Content : <?php echo $row['content'] ?>
</table>
<?php
}
?>
Thanks~
mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ...
here is my code:
<?php
//connected to the db
$result = mysql_query("SELECT TOP 5 * FROM news ORDER BY ID DESC");
while ($row = mysql_fetch_assoc($result))
{
?>
<table>
Title : <?php echo $row['title'] ?>
Content : <?php echo $row['content'] ?>
</table>
<?php
}
?>
Thanks~