Jump to content

only last filed is updated every where


amaldasm11sterling

Recommended Posts

this is the script for viewing the data in edit mode

<tr>

      <td width="67" height="24"><select name="qualifi">

        <option selected="selected">None</option>

          <?php

$qry=mysql_query("select * from qualification");

while($obj=mysql_fetch_array($qry))

{

?>

          <option value="<?php echo $obj[0]; ?>"<?php if($obj[0]==$qualifi) echo("selected"); ?>><?php echo $obj[1]; ?></option> 

          <?php

}

?>

</select>

      </td>

 

 

    <?php

      echo"<td width='301'><input name='board' type='text'  size='50' value='$board'/></td>";

  echo"<td width='60'><input name='start' type='text' size='10' value='$start'/></td>";

      echo"<td width='60'><input name='end' type='text' size='10' value='$end'/></td>";

      echo"<td width='60'><input name='percentage' type='text' size='10' value='$percentage'/></td>

    </tr>";

 

}

?>

</table>

 

and the update query is like

//qualification

if($_SESSION[empcode]!="")

{

if($_SESSION[qualifi]!="None")

{

mysql_query("update HRMEMPQUAL set EMPCODE='$_SESSION[empcode]',QUALCODE='$_SESSION[qualifi]',BOARD='$_SESSION[board]',FROMYEAR='$_SESSION[start]',TOYEAR='$_SESSION[end]',MARK_PERCENT='$_SESSION[percentage]' where EMPCODE='$_SESSION[empcode]'");

}

}

how can i save all the data correctly while any change is take  place...their are 3 rows of data.only the last fled data is updated all the 3 rows

Link to comment
Share on other sites

all your $_SESSION variables are invalid, I'm surprised that's even doing anything...

 

this:

$_SESSION[empcode]

 

should be:

// if the array key name is called empcode
$_SESSION['empcode']

 

or

// if you're getting the array key name from a variable called $empcode
$_SESSION[$empcode]

 

* you need to fix ALL your $_SESSION variables

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.