This question already has an answer here:
This is my code
<?php
$result = mysql_query("SELECT * FROM post WHERE username = ".$username." ORDER BY ID DESC ");
while($row = mysql_fetch_array($result)){
?>
<div class="post">
<a href="/p/<?php echo $row['ID']; ?>" class="post-title"><?php echo $row['title']; ?> - (Rating: <?php echo $row['rank']; ?>)</a>
<p class="post-content"><?php echo $row['description']; ?><br /><br />On <?php echo $row['date']; ?></p>
</div>
<?php }; ?>
But I get this error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /*/programs/user.php on line 77
vb_posts
WHEREusername
= \'joshblease\' ORDER BYID
DESC"; – Josh Luke Blease Oct 14 '12 at 14:01