Ben bir mysql sorgu çalışan var ve bir yineleyici 1'e eşit ise, o zaman bu div başlığı görüntülemek görmek için denetler ...
if ($this->dliterator == 1) {echo "<div class='clientsection' id='downloads'>Downloads</div><br/>";};
Sorun, dl yineleyici mutlaka 1'den başlamak olmayabilir olmasıdır. (Doğrudan veritabanından bir downloadid ile ilgilidir).
Nasıl bu sadece döngü ilk kez gösterilecek alabilirsiniz ONLY?
while ($row = mysql_fetch_assoc($result)) {
if ($row['download'] != null){
if ($this->dliterator == 1) {echo "<div class='clientsection' id='downloads'>Downloads</div><br/>";};
if ($editDownload == 1) {
echo "<div class='clientlink' style='margin-top: 15px;'>";
echo "<input name='downloads[$this->dliterator][name]' type='text' id='download$this->dliterator' value='" . $row['download'] . "'/>";
echo "<input name='downloads[$this->dliterator][title]' type='text' id='downloadtitle$this->dliterator' value='" . $row['downloadtitle'] . "'/>";
echo "<img class='removelink' src='/images/deletelink.png' width='15' />";
echo "<input id='downloadid' name='downloads[$this->dliterator][id]' type='hidden' value='".$row['downloadid']."' style='display: none'/>";
echo "<br/><img id='uploaddownload$uploaditerator' class='uploaddownload' src='../images/upload.png' width='80'/>";
echo "</div>";
};
};
$this->dliterator++;
$uploaditerator++;
};
Tüm cevaplar için teşekkürler! İşte benim çalışma çözüm Zuul sayesinde bulunuyor:
if ($row['download'] != null){
if (($this->dliterator != null ) && ($check ==0)) {echo "<div class='clientsection' id='downloads'>Downloads</div><br/>";
$check++;};