<div id="main_content">
<?php
//error_reporting(0);
include("includes/connect.php");
$select_posts = " select * from posts ";
$run = mysql_query($select_posts);
while($row = mysql_fetch_array($run_posts)) {
$post_id = $row['post_id'];
$post_title = $row['post_title'];
$post_date = $row['post_date'];
$post_author = $row['post_author'];
$post_image = $row['post_image'];
$post_keywords = $row['post_keywords'];
$post_content = $row['post_content'];
?>
<h2> <?php echo $post_title; ?> </h2>
<?php } ?>
</div>
在創建CMS我顯示主頁上的內容,但得到通常的錯誤和警告未定義的變量:run_posts和警告:mysql_fetch_array()預計參數1是資源,空給出
注意:未定義變量:run_posts在C:\ wamp \ www \ CMS \ includes \ main_content.php在第10行
警告:mysql_fetch_array()期望參數1爲資源,C:\ wamp \ www \ CMS \包括第10行的\ main_content.php