Merhaba Arkadaşlar if(!mysql_affected_rows()){?> kodu ile mysql de çekiyordum ama pdo olarak nasıl kullanıcam ?
$sorgu->rowcount() denedim ama
Fatal error: Call to a member function rowcount() on null in.../dosya.phpon line38 şeklinde hata alıyorum. sorun nedir acaba ?
Kodlar;
<?php require_once 'header.php';

islemkontrol();


?>


<div class="container">
<div class="my-products clearfix">
<h1>SİPARİŞLERİM</h1>

<div class="list">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>
# Sipariş NO
</th>


<th>
Sipariş Tutarı
</th>
<th>
Durum
</th>
<th>
İşlemler
</th>
</tr>
</thead>
<tbody>
<?php $Sorgu=$db->prepare("SELECT * FROM detay WHERE id = '{$_SESSION['id']}' ORDER BY sno DESC");

if(!mysql_affected_rows()){?> /* DEĞİŞTİRİLEN KOD;  if ($sorgu->rowcount()) {?> */

<tr>
<td colspan="7">
Siparişiniz bulunmuyor
</td>
</tr>
<?php }else{
while($Sonuc = Sonuc($Sorgu)){?>
<tr>
<td>
<a href="Siparis/<?php echo $Sonuc->sno;?>.html"><b># <?php echo $Sonuc->sno;?></b></a>
</td>


<td>
<?php echo $Sonuc->fiyat;?> TL
</td>
<td>
<span class="label label-sm label-warning"> Onay Bekliyor </span>
</td>
<td>
<a href="siparis-detay.php/<?php echo $Sonuc->id;?>.html" class="btn btn-xs btn-success">
<i style="margin-top: 2px;" class="fa fa-eye"></i> Detaylar
</a>
</td>
</tr>
<?php }}?>
</tbody>
</table>
</div>
</div>
</div>

<?php require_once 'footer.php'; ?>