我希望它显示该文章,但仅向我显示此内容: 解析错误:语法错误,意外的':',第3行的C:\ xampp \ htdocs \ cms \ includes \ article.php中的预期标识符(T_STRING)(第3行是:class:article;)
<?php
class: article;
{
public function fetch_all();
{
global $pdo;
$query = $pdo->prepare("SELECT * FROM articles");
$query->execute();
return $query->fetchAll();
}
}
?>
第二个php代码是包含代码
<?php
include_once('C:\xampp\htdocs\cms\includes\connection.php');
include_once('C:\xampp\htdocs\cms\includes\article.php');
$article = new Article;
$articles = $article->fetch_all();
echo time();
?>