職位的循環這是使用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 –