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 />";
      }
    }
  }

?>

Link to comment
Share on other sites

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

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.