职位的循环这是使用phpMyAdmin数据库我的第一个代码....它doesen't工作有人可以帮助我:)创建数据库
<?php
$bdd = new PDO('mysql:host=localhost;dbname=mydatabase, root, ');// serveur test
$requete = $bdd->query('SELECT * FROM posts');
while($data = $requete->fetch()){
echo'<article class="format-standard">
<div class="feature-image">
<a href="page.php?id='.$data['id'].'" data-rel="prettyPhoto"><img src="'.$data['img'].'" alt="Alt text" /></a>
</div>
<h1>
<a href="page.php?id='.$data['id'].'" class="post-heading">'.$data['title'].'</a>
</h1>
<div class="meta">
<span class="entry-date">'.$data['date'].'</span>
in
<span class="categories">
<a href="#">Category 1</a>,
<a href="#">Category 2</a>
</span>
</div>
<div class="excerpt">'.$data['description'].'</div>
<a href="page.php?id='.$data['id'].'" class="read-more">read more</a>
</article>';
};
$requete->closeCursor();
?>
我要创造我的页面,我的一些帖子有类别:(任何帮助请问!
可以请你告诉我们你的桌子的结构吗? – Cristian
'phpmyadmin数据库'这是非常有趣的... – bartek
hihihihihi @bartek –