mysql データベースからカテゴリを取得して表示しようとしていますが、それを php インクルードを介してインデックス ページに追加しています。
<?php //which category are we showing?
$category_id = $_GET['catid']; ?>
<h2>All Categories</h2>
<?php
//get 2 latest published posts
$query_latest = "SELECT title, body, date, category_id, post_id
FROM posts
WHERE is_published = 1
AND category_id = $category_id
ORDER BY date DESC";
//run the query code on the DB
$result_latest = mysql_query( $query_latest );
//loop it, work with one post at a time
while( $row_latest = mysql_fetch_array( $result_latest ) ){ ERROR ROW 19
?>
<div class="post">
<h2><?php echo $row_latest['title'] ?></h2>
<h3>Posted on <?php echo $row_latest['date']; ?> in the category of something</h3>
<p><?php echo $row_latest['body'] ?></p>
</div>
<?php } //end while loop ?>
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given
in C:\xampp\htdocs\schellshockdesign.com\term5final\finalproject\category.php
on line 19