• 03-02-2009, 20:24:48
    #1
     <tr>
          <th scope="row">2.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 1,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=2&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">3.</th>
          <th scope="row"><?
       $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 2,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=3&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">4.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 3,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=4&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">5.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 4,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=5&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">6.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 5,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=6&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">7.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 6,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=7&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">8.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 7,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=8&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">9.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 8,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=9&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">10.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 9,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=10&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">11.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 10,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=11&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">12.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 11,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=12&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">13.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 12,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=13&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">14.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 13,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=14&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">15.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 14,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=15&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">16.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 15,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=16&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">17</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 16,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=17&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">18</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 17,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=18&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">19</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 18,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=19&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">20</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">21</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">22</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">23</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">24</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">25</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">26</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">27</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">28</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">29</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">30</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 19,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=20&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
    Bu benim sınavımın cevap kağıtlarını oluşturuyor.Ama her sınıf için ayrı ayrı include ettiğim bu kod tekrarı yığını için bir fonksiyon yazayım dedim elime yüzüme bulaştırdım.Arkadaşlar bu sürekli devinen şeyi bir çırpıda zıyptıracak deli manyak bir fonksiyon önerebilen birisi var mı?
  • 03-02-2009, 21:28:48
    #2
    ciktisini da verirmisin while ile halledelim
  • 03-02-2009, 22:00:29
    #3
    Üyeliği durduruldu
    tanermacit adlı üyeden alıntı: mesajı görüntüle
    Bu benim sınavımın cevap kağıtlarını oluşturuyor.Ama her sınıf için ayrı ayrı include ettiğim bu kod tekrarı yığını için bir fonksiyon yazayım dedim elime yüzüme bulaştırdım.Arkadaşlar bu sürekli devinen şeyi bir çırpıda zıyptıracak deli manyak bir fonksiyon önerebilen birisi var mı?

    kodlara baktim yalniz kodların altına yazdığınız bu ifadeden şahsım adına hiç birşey anlamadim
  • 03-02-2009, 22:14:44
    #4
    <?php
    $say = "1";
    $result=mysql_query("SELECT * from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 1,20");
    while ($a = mysql_fetch_array($result)) {
    $say++;
    ?>
    <tr>
    <th scope="row"><?php echo $say;?></th>
    <th scope="row">
    <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=2&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[resim];?>" border="0"></a></th>
    </tr> 
    <?php
    }
    ?>
    böyle tahmini birşey yaptim,
    <? echo $a[resim];?> tablondaki sütunun adini bilmedigim için tahmini resim yazdim onu sen değiştirirsin
    dene istedigin sonucu vermezse tekrar bakalım
  • 03-02-2009, 22:51:45
    #5
    arkadaşlar hemen inceleyip size olumlu olsumzu döneceğim teşekkürler
  • 04-02-2009, 00:42:06
    #6
    Merhaba Lacremel;
    Sen sadece satır için sıralama yapmışsın ama koda dikkat edersen değişen başka şeylerde var.
    <tr> ile </tr> arasında değişen 3 çeşit rakam var mesela en sonundaki (0,1)(1,1)2,1)...şeklinde gidiyor ve soruno=1 soruno=2 gibi değişkenler var .Mantığı anladım ama o while döngüsünü o kodda dediğim yerlere nasıl yerleştirebilirm.
  • 04-02-2009, 00:56:48
    #7
    bu sorgunun ciktisini görebilirsen daha rahat yardimci olurum
  • 04-02-2009, 01:10:49
    #8
    <th width="17" scope="row">1.</th>
          <th width="71" scope="row"><a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=1&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" >
            <?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 0,1;");
    $a=mysql_fetch_row($result);
    
    ?>
            <img src="/gununsorusu/upload/<? echo $a[4]; ?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">2.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 1,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=2&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">3.</th>
          <th scope="row"><?
       $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 2,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=3&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">4.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 3,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=4&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">5.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 4,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=5&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">6.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 5,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=6&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">7.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 6,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=7&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">8.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 7,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=8&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">9.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 8,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=9&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">10.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 9,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=10&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">11.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 10,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=11&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">12.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 11,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=12&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">13.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 12,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=13&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">14.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 13,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=14&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">15.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 14,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=15&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">16.</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 15,1 ;");
    $a=mysql_fetch_row($result);
    ?>
            <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=16&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">17</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 16,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=17&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">18</th>
          <th scope="row"><?
    $result=mysql_query("SELECT kullanicino,sinif,denemeno,soruno ,uyecevap from karne where kullanicino='$kullanicino' and sinif='$sinif' and ders='$ders' and denemeno='$denemeno'  order by soruno asc limit 17,1 ;");
    $a=mysql_fetch_row($result);
    ?>
          <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=18&kullanicino=<? echo $kullanicino; ?>&ders=<? echo $ders; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[4];?>" border="0"></a></th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
        </tr>
        <tr>
          <th scope="row">&nbsp;</th>
          <th scope="row">&nbsp;</th>
    bu dosyayı anasayfaya include ettiriyorum ve ekteki resimde kırmızı ile gösterdiğim yeri alıyorum.Aslında sorun yok ama ben bunu daha kısa yapmak istiyorum.Sorunun numaralarını sıralatmada sorunum yok ama sorun.o parantez içindeki (0,1) (1,1) (2,1) şekilnde giden sorguun içinde nasıl devinim yapacağım.İnşallah bu sefer anlatabilmişimdir.
  • 04-02-2009, 01:33:41
    #9
     <?php
    $say = "1";
    $result=mysql_query("SELECT * from karne where kullanicino='$kullanicino' and sinif='$sinif' and denemeno='$denemeno'  order by soruno asc limit 0,20");
    while ($a = mysql_fetch_array($result)) {
    $say++;
    ?>
    <tr>
    <th scope="row"><?php echo $say;?></th>
    <th scope="row">
    <a href="/uyelik/deneme.php?sinif=<? echo $sinif;?>&denemeno=<? echo $denemeno; ?>&username=<? echo $username; ?>&soruno=<?php echo $say; ?>&kullanicino=<? echo $kullanicino; ?>" class="highlightit" ><img src="/gununsorusu/upload/<? echo $a[resim];?>" border="0"></a></th>
    </tr> 
    <?php
    }
    ?>
    Yukardaki sorguda ; soruno 0. kayittan baslar soruno 20 ye kadar devam eder yani yukardaki html kodlarini 20 defa basar. sende burada 20 defa basmişssin(belki daha fazla ortalama 20). biz bunu while ile yaptik.


    daha da acmak gerekirse ;
    0,1 = 0. kayittan basla 1 kayit al
    1,1 = 1. kayittan basla 1 kayit al
    2,1 = 2. kayittan basla 1 kayit al
    .....
    .....
    19,1 = 19. kayittan basla 1 kayit al
    ----------------------------------------
    Toplam 20 kayit.


    benim yaptigim while da sorguyu 20 defa döndürecek

    anlatabilmişimdir umarim