Hey çocuklar ben mysql sonuçlarından atanmış bir dizi var ve ben sadece birinde başlayan sayı onları istiyorum. Herkes bunu biliyor mu?
while ($row=mysql_fetch_assoc($query)){
$out[] = array("ASSIGNED INTEGER", $row['total']);
}
Eğer konum çizgi takip etmek, bir sayaç olarak bir değişken kullanmak gerekir:
$counter = 1;
while ($row=mysql_fetch_assoc($query)){
$out[] = array($counter, $row['total']);
$counter++;
}
Or, if you want your resulting $out array have results indexed from 1, instead of 0, you could use something like this to set the index yourself :
$counter = 1;
while ($row=mysql_fetch_assoc($query)){
$out[$counter] = $row['total'];
$counter++;
}
Ya da bu türetilmiş herhangi bir fikir.