$db = new PDO("mysql:host=localhost;dbname=example","root","password");
$bilgi = $db->prepare("SELECT * FROM table ORDER BY id ASC LIMIT 5 ");
$bilgi->execute(array());
While($row=$bilgi->fetch(PDO::FETCH_ASSOC)){
echo $row['id'] .'
';
}
?>
Konu: PDO Yardım
$db = new PDO("mysql:host=localhost;dbname=example","root","password");
$bilgi = $db->prepare("SELECT * FROM table ORDER BY id ASC LIMIT 5 ");
$bilgi->execute(array());
While($row=$bilgi->fetch(PDO::FETCH_ASSOC)){
echo $row['id'] .'
';
}
?>