
PHP'de PDO kullanarak örnek olarak
echo $config_sor['site_url'];gibi çekmek istiyorum verileri bunu nasıl yapabilirim bir fikrim yok yardımcı olabilir misiniz ?
4
●348
<?php
$sorgu = $dbh->prepare("SELECT * FROM blog");
$sorgu->execute();
while ($sonuc = $sorgu->fetch()) {
$id = $sonuc['id'];
$baslik = $sonuc['baslik'];
$kisa_aciklama = $sonuc['kisa_aciklama'];
$foto = $sonuc['foto'];
$baslikseo=seo( $sonuc['baslik']);
?>toplu çekim yapmak istiyorsan yani listeleyecek isen eğer, veriyi böyle çekip<?=$sonuc['baslik'];?> ile yerleştirme yapicaksın en sona da <?php } ?> koyup bitiriceksinama tek id'li veri çekiceksen eğer
<?php
$ayar = $dbh->query("SELECT * FROM ayar WHERE id = 1 ", PDO::FETCH_ASSOC);
if ($ayar->rowCount()) {
foreach ($ayar as $ayar) {
}
}
?>
<?=$ayar['sayfa_baslik'];?> $kullanicisor = $db->prepare("select * from users where username=:username");
$kullanicisor->execute(array('username' => $_SESSION['user_nick']));
$kullanici = $kullanicisor->fetch(PDO::FETCH_ASSOC);$kullanici['username'];