<?php
function menuler($ustid) {
global $db;
$sql = $db->query("SELECT * FROM menuler WHERE ustid = $ustid ORDER BY sira ASC");
foreach ($sql as $row_Sub) {
$Catid = $row_Sub['id'];
$ust = $db->column("SELECT ustid FROM menuler WHERE ustid = $Catid");
$toplam_Alt = count($ust);
if ($toplam_Alt > 0) echo '<li class="drop">';
else echo '<li>';
?>
<a href="<?=$row_Sub['id'];?>"><span></span><?=$row_Sub['baslik'];?></a>
<?php if($toplam_Alt > 0) { ?>
<ul class="drop-down">
<?=menuler($Catid);?>
</ul>
<? } ?>
</li>
<?php }
}
?>Merhaba böyle bir kodum var burada 2 yerde db kullanmışım.
$sql den gelen değer array tarzı
$ust = $db->column("SELECT ustid FROM menuler WHERE ustid = $Catid");
$toplam_Alt = count($ust);bunu php array nasıl count edip mysql kullanmadan halledebilirim?