While döndüsü ile aldığım listede son idyi çekiyor güncelleme yapmak istediğimde

thex thex

Alt alta listelettiğim kayıtlar var. Aşağıda konu farklı fakat ben size mantık üzerinden sorayım. Adı soyadı haneleri önceden girilmiş ve güncelleme butonuna tıklayıp tel ve email girip kaydet diyoruz. Burada personel listesinin sonunda yer alan personelde güncelleme yapıyor ve bu problemi bir türlü çözemedim.

Dediğim gibi aşağıdaki konu farklı ama mantık bu şekilde. Aşağıdaki forumda isEmriIDyi form ile gönderip updatede sorguya dahil ediyorum. Ama hep tablodaki son kaydın idsine göre işlem yapıyor.

 

Form verisi olan yerin kodları;

 

<form name="isemri_kayit" method="post" action="?page=isEmri&q=modulKayit">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#A9C8FC" style="border-collapse: collapse; font-family: Tahoma, Geneva, sans-serif; font-size: 12px;">
    <tr bgcolor="#B0DCFF">
      <td width="42" align="left" style="text-align: center"><strong>Mod&uuml;l No</strong></td>
      <td width="104" align="left" style="text-align: center"><strong>T&uuml;r</strong></td>
      <td width="104" align="left" style="text-align: center"><strong>G&ouml;rsel kontrol operat&ouml;r&uuml;</strong></td>
      <td width="78" align="left" style="text-align: center"><strong>G&ouml;rsel kontrol sonucu</strong></td>
      <td width="78" align="left" style="text-align: center"><strong>Mod&uuml;l sınıfı</strong></td>
      <td width="62" align="left" style="text-align: center"><strong>Hipot test</strong></td>
      <td width="57" align="left" style="text-align: center"><strong>Maksimum g&uuml;&ccedil;</strong></td>
      <td width="10" align="left" style="text-align: center">&nbsp;</td>
      <td width="104" align="left" style="text-align: center"><strong>Test operat&ouml;r&uuml;</strong></td>
      <td width="81" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Cam</strong></td>
      <td width="86" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>H&uuml;cre</strong></td>
      <td width="105" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Folyo</strong></td>
      <td width="90" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Arka Şilte</strong></td>
      <td width="77" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Ribon-Stringer</strong></td>
      <td width="74" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Fluks</strong></td>
      <td width="99" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Ribon-İnterconnection</strong></td>
      <td width="67" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>H&uuml;cre yapıştırma bandı</strong></td>
      <td width="66" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>&Ccedil;er&ccedil;eve bandı</strong></td>
      <td width="67" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>&Ccedil;er&ccedil;eve</strong></td>
      <td width="72" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Bağlantı kutusu</strong></td>
      <td width="111" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Yapıştırıcı</strong></td>
      <td width="83" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Plastik k&ouml;şebent</strong></td>
      <td width="59" align="left" bgcolor="#FFCCFF" style="text-align: center"><strong>Etiket</strong></td>
      <td width="54" align="left" bgcolor="#FFCCFF" style="text-align: center">&nbsp;</td>
    </tr>
   
<?PHP
  $sorgu = mysql_query("select * from isemri order by id") or die("Hata Olustu-İş emri!");
  while($oku=mysql_fetch_array($sorgu))
  {
?>
    <tr class="x" onmouseover="this.style.backgroundColor='#CBDFED'" onmouseout="this.style.backgroundColor='#ffffff';">
      <td align="left" style="text-align: center"><b><?PHP echo $oku["modulNoRakam"]; ?>-<?PHP echo $oku["modulNoRakamSeri"]; ?>-<?PHP echo $oku["id"]; ?></b></td>
<input type="hidden" name="isEmriID" class="isEmriID" value="<?PHP echo $oku["id"]; ?>" />
      <td align="left" style="text-align: center"><label for="modulTuru"></label>
        <select name="modulTuru" id="tur">
        <option value="SPE-01">SPE-01</option>
        <option value="SPE-02">SPE-02</option>
        <option value="SPE-03">SPE-03</option>
        <option value="SME-01">SME-01</option>
        <option value="SME-02">SME-02</option>
        <option value="SME-03">SME-03</option>
      </select></td>
      <td align="left" style="text-align: center">
        <span id="spryselect4">
          <label for="gorselKontrolOperatorID"></label>
          <select name="gorselKontrolOperatorID" id="gorselKontrolOperatorID">
          <option>OPERATÖR SE&Ccedil;</option>
<?PHP
  $sorguGorsel = mysql_query("SELECT * FROM personel order by adi desc") or die("Hata Olustu!");
  while($okuGorsel=mysql_fetch_array($sorguGorsel))
  {
?>
        <option value="<?PHP echo $okuGorsel["id"]; ?>"><?PHP echo $okuGorsel["adi"]; ?> <?PHP echo $okuGorsel["soyadi"]; ?></option>
<?PHP } ?>
        </select>
         <span class="selectRequiredMsg">Lütfen bir öğe seçin.</span></span>
      </td>
      <td align="left" style="text-align: center"><span id="sprytextarea1">
        <label for="gorselKontrolSonucu"></label>
        <textarea name="gorselKontrolSonucu" id="gorselKontrolSonucu" cols="10" rows="1"></textarea>
      <span class="textareaRequiredMsg">Bir değer gerekiyor.</span></span></td>
      <td align="left" style="text-align: center"><span id="spryselect5">
        <label for="modulSinifi"></label>
        <select name="modulSinifi" id="modulSinifi">
        <option value="" selected="selected">SINIF</option>
        <option value="A">A</option>
        <option value="B">B</option>
        <option value="C">C</option>
        <option value="HURDA">HURDA</option>
      </select>
      <span class="selectRequiredMsg">Lütfen bir öğe seçin.</span></span></td>
      <td align="left" style="text-align: center"><span id="spryselect6">
        <label for="hipotTest"></label>
        <select name="hipotTest" id="hipotTest">
        <option value="" selected="selected">SEÇ</option>
        <option value="OK">OK</option>
        <option value="NOK">NOK</option>
      </select>
      <span class="selectRequiredMsg">Lütfen bir öğe seçin.</span></span></td>
      <td align="left" style="text-align: center"><span id="sprytextfield3">
        <label for="maksimumGuc"></label>
        <input type="text" name="maksimumGuc" id="maksimumGuc" size="1" maxlength="3" max="3" />
      <span class="textfieldRequiredMsg">Bir değer gerekiyor.</span></span></td>
      <td align="left" style="text-align: center">&nbsp;</td>
      <td align="left" style="text-align: center"><label for="testOperatorID"></label>
        <select name="testOperatorID" id="testOperatorID">
          <option>OPERATÖR SE&Ccedil;</option>
<?PHP
  $sorguTest = mysql_query("SELECT * FROM personel order by adi desc") or die("Hata Olustu!");
  while($okuTest=mysql_fetch_array($sorguTest))
  {
?>
        <option value="<?PHP echo $okuTest["id"]; ?>"><?PHP echo $okuTest["adi"]; ?> <?PHP echo $okuTest["soyadi"]; ?></option>
<?PHP } ?>
        </select></td>
      <td align="left" style="text-align: center"><label for="camID"></label>
        <select name="camID" id="camID">
<?PHP
  $sorguCam = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Cam' order by id desc") or die("Hata Olustu-Cam!");
  while($okuCam=mysql_fetch_array($sorguCam))
  {
?>
        <option value="<?PHP echo $okuCam["id"]; ?>"><?PHP echo WordLimiter($okuCam["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="hucreID"></label>
        <select name="hucreID" id="hucreID">
<?PHP
  $sorguHucre = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Hücre' order by id desc") or die("Hata Olustu-Hücre!");
  while($okuHucre=mysql_fetch_array($sorguHucre))
  {
?>
        <option value="<?PHP echo $okuHucre["id"]; ?>"><?PHP echo WordLimiter($okuHucre["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="folyoID"></label>
        <select name="folyoID" id="folyoID">
<?PHP
  $sorguFolyo = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Folyo' order by id desc") or die("Hata Olustu-Folyo!");
  while($okuFolyo=mysql_fetch_array($sorguFolyo))
  {
?>
        <option value="<?PHP echo $okuFolyo["id"]; ?>"><?PHP echo WordLimiter($okuFolyo["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="arkaSilteID"></label>
        <select name="arkaSilteID" id="arkaSilteID">
<?PHP
  $sorguArkaSilte = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Arka Şilte' order by id desc") or die("Hata Olustu-Arka Şilte!");
  while($okuArkaSilte=mysql_fetch_array($sorguArkaSilte))
  {
?>
        <option value="<?PHP echo $okuArkaSilte["id"]; ?>"><?PHP echo WordLimiter($okuArkaSilte["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="ribonStringerID"></label>
        <select name="ribonStringerID" id="ribonStringerID">
<?PHP
  $sorguRibon = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Ribon' order by id desc") or die("Hata Olustu-Ribon!");
  while($okuRibon=mysql_fetch_array($sorguRibon))
  {
?>
        <option value="<?PHP echo $okuRibon["id"]; ?>"><?PHP echo WordLimiter($okuRibon["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="fluksID"></label>
        <select name="fluksID" id="fluksID">
<?PHP
  $sorguFluks = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Fluks' order by id desc") or die("Hata Olustu-Fluks!");
  while($okuFluks=mysql_fetch_array($sorguFluks))
  {
?>
        <option value="<?PHP echo $okuFluks["id"]; ?>"><?PHP echo WordLimiter($okuFluks["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="ribonInterconnectionID"></label>
        <select name="ribonInterconnectionID" id="ribonInterconnectionID">
<?PHP
  $sorguRibon = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Ribon' order by id desc") or die("Hata Olustu-Ribon!");
  while($okuRibon=mysql_fetch_array($sorguRibon))
  {
?>
        <option value="<?PHP echo $okuRibon["id"]; ?>"><?PHP echo WordLimiter($okuRibon["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="hucreYapistirmaBandiID"></label>
        <select name="hucreYapistirmaBandiID" id="hucreYapistirmaBandiID">
<?PHP
  $sorguBant = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Bant' order by id desc") or die("Hata Olustu-Bant!");
  while($okuBant=mysql_fetch_array($sorguBant))
  {
?>
        <option value="<?PHP echo $okuBant["id"]; ?>"><?PHP echo WordLimiter($okuBant["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="cerceveBandiID"></label>
        <select name="cerceveBandiID" id="cerceveBandiID">
<?PHP
  $sorguBant = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Bant' order by id desc") or die("Hata Olustu-Bant!");
  while($okuBant=mysql_fetch_array($sorguBant))
  {
?>
        <option value="<?PHP echo $okuBant["id"]; ?>"><?PHP echo WordLimiter($okuBant["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="cerceveID"></label>
        <select name="cerceveID" id="cerceveID">
<?PHP
  $sorguCerceve = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Çerçeve' order by id desc") or die("Hata Olustu-Çerçeve!");
  while($okuCerceve=mysql_fetch_array($sorguCerceve))
  {
?>
        <option value="<?PHP echo $okuCerceve["id"]; ?>"><?PHP echo WordLimiter($okuCerceve["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="baglantiKutusuID"></label>
        <select name="baglantiKutusuID" id="baglantiKutusuID">
<?PHP
  $sorguBaglantiKutusu = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Bağlantı Kutusu' order by id desc") or die("Hata Olustu-Bağlantı Kutusu!");
  while($okuBaglantiKutusu=mysql_fetch_array($sorguBaglantiKutusu))
  {
?>
        <option value="<?PHP echo $okuBaglantiKutusu["id"]; ?>"><?PHP echo WordLimiter($okuBaglantiKutusu["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="yapistiriciID"></label>
        <select name="yapistiriciID" id="yapistiriciID">
<?PHP
  $sorguYapistirici = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Yapıştırıcı' order by id desc") or die("Hata Olustu-Yapıştırıcı!");
  while($okuYapistirici=mysql_fetch_array($sorguYapistirici))
  {
?>
        <option value="<?PHP echo $okuYapistirici["id"]; ?>"><?PHP echo WordLimiter($okuYapistirici["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="plastikKosebentID"></label>
        <select name="plastikKosebentID" id="plastikKosebentID">
<?PHP
  $sorguKosebent = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Köşebent' order by id desc") or die("Hata Olustu-Köşebent!");
  while($okuKosebent=mysql_fetch_array($sorguKosebent))
  {
?>
        <option value="<?PHP echo $okuKosebent["id"]; ?>"><?PHP echo WordLimiter($okuKosebent["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="left" style="text-align: center"><label for="etiketID"></label>
        <select name="etiketID" id="etiketID">
<?PHP
  $sorguEtiket = mysql_query("SELECT * FROM tedarikciler Where aitOlduguHat='Etiket' order by id desc") or die("Hata Olustu-Etiket!");
  while($okuEtiket=mysql_fetch_array($sorguEtiket))
  {
?>
        <option value="<?PHP echo $okuEtiket["id"]; ?>"><?PHP echo WordLimiter($okuEtiket["tedarikci_adi"]); ?></option>
<?PHP } ?>
      </select></td>
      <td align="right" style="text-align: center"><input type="submit" name="kaydet" id="kaydet" value="Gönder" />
      </td>
    </tr>
<?PHP } ?>
</table>
</form>

<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "date", {format:"dd/mm/yyyy", hint:"\xD6rn: 01.01.2015", useCharacterMasking:true});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "integer", {minChars:1, maxChars:3, useCharacterMasking:true});
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2");
var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4");
var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5");
var spryselect6 = new Spry.Widget.ValidationSelect("spryselect6");
var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
</script>

 

 

 

 

 

 

 

 

GÜNCELLEME VERİSİNİN OLDUĞU YERİN KODLARI

<?php
@$isEmriID                    =$_POST["isEmriID"];
@$modulTuru                    =$_POST["modulTuru"];


$guncelle = mysql_query("UPDATE isemri SET modulTuru='$modulTuru' WHERE id='$isEmriID'");

echo "<center><img src=images/ok.gif border=0 /> Modül Kaydedildi ($id)!</center>";
header("Refresh: 1; url= index.php?page=isEmri&q=acikIsEmirleri");

mysql_close();
?>

17-03-2015 09:20

    www.Phpkodlari.com © 2009 Herkes Php öğrenecek
    Web tasarım ve eğitim kaynağınız.