Jump to content

adding multiple entries with one click


kevincro

Recommended Posts

Are they all to be the same entry? Sorry, but that doesn't seem very usefull.

 

Its easy enough though.

 

<?php

  if (isset($_POST['num'])) {
    for ($i = 1;$i <= $_POST['num'];$i++) {
      if (mysql_query($sql)) { where $sql is your query.
        echo "Row $i added<br />";
      } else {
        echo "Row $i failed<br />";
      }
    }
  }

?>

Well what I have is a system that allows people to offer items for sale to other members, With this I can allow the user to submit multiple entries for the amount of items of the same type.  Each row represents an individual item.  When a member purchases an item it places that row of data into a sold items db table and removes it from the list of available items.  As it stands, user can submit multiple items but only by using their back button in their browser and clicking submit again and again.  I feel that this is a very crude and potentially detrimental way of accomplishing this task.  Thanks for the code.

KC

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.