Editing records when selected from a dropdown

  • gromituk2k
  • Newbie
  • Newbie
  • User avatar
  • Posts: 14
  • Loc: West Yorkshire, England

Post 3+ Months Ago

I have a simple MySQL database set up with one table (lots) which stores the following details:
    id
    description
    bid
    table
    name
    paid

All the users will be able to do is edit existing records.
The user will select from a drop down menu containing the description, this will then display the 'bid' for that item below. On changing the drop down menu selection, will then change and display the 'bid' for that item.

The code for this drop down that I am using is:
PHP Code: [ Select ]
<select name="descriptionitem" id="descriptionitem">
<?php
include('db.php');
$sql="SELECT * FROM lots";
$result =mysql_query($sql);
while ($data=mysql_fetch_assoc($result)){
?>
<option value ="<?php echo $data['id'] ?>" ><?php echo $data['descriptionitem'] ?></option> <?php } ?>
</select>
 
  1. <select name="descriptionitem" id="descriptionitem">
  2. <?php
  3. include('db.php');
  4. $sql="SELECT * FROM lots";
  5. $result =mysql_query($sql);
  6. while ($data=mysql_fetch_assoc($result)){
  7. ?>
  8. <option value ="<?php echo $data['id'] ?>" ><?php echo $data['descriptionitem'] ?></option> <?php } ?>
  9. </select>
  10.  


Underneath this would be three text boxes for 'bid', 'table' and 'name', once clicked submit it would update that record on the database, only if the new 'bid' value is larger than the current 'bid' value saved.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 69 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.