Bir süre döngü sıfırlama

0 Cevap php

Ben bazı javascript oluşturmak için yazıyorum bir php komut dosyası kafa karıştırıcı bir şey bulduk. İşte, aşağıda biraz basitleştirilmiş.

İkinci ben döngü ise tüm ilk açıklama sürece döngü çalıştırmak olmaz ise. Herkes neden açıklayabilir misiniz? Çok teşekkürler.

<?php
$listid = 2; //DEMO ONLY
$result1 = mysql_query("SELECT words.wid,words.wordmd5,words.word FROM words,instances WHERE words.wid = instances.wid AND instances.lid = \"$listid\"");
$result1copy = $result1;

$count1 = 1;
while( $row = mysql_fetch_object( $result1 ) )
{
print "words_left[$count1] = \"".$row->word."\";\n";
//Increment the array counter (starts at 1)
$count1++;
}
?>

//Some javascript

  <?php      

  $count2 = 1;
while( $row = mysql_fetch_object( $result1copy ) )
{    
print "
    $count2 then $row->wordmd5
";    
$count2++;
}
?>

0 Cevap