Ravenous adlı üyeden alıntı: mesajı görüntüle
<?php
$x = 0;
while ($sonuc = $sorgu->fetch()) { ?>

<div class="carousel-item <?php if($x==0) {echo 'active'; }?>">
<img src="slider/<?= $sonuc['foto'];?>" alt="">
<div class="carousel-caption">
<p class="animated fadeInRight"><?= $sonuc['ustBaslik'] ?></p>
<h1 class="animated fadeInLeft"><?= $sonuc['baslik'] ?></h1>
</div>
</div>

<?php $x++; }?>

ya da echo ($x==0) : 'active' ? '';
Çok teşekkür ederim hocam sağolun

sabankutluca adlı üyeden alıntı: mesajı görüntüle
çünkü tüm döngüye nactive itemini vermişin.
Evet hocam çözüldü sorun