Jump to content

multiple submit buttons on one page


Goose87

Recommended Posts

Ok, to put this all into context i have a table created through echo's which display data from the database.  The database has multiple items in the thing, so i have lots of rows.  Each row has a submit button on it with a different hidden ID, which is $row[0], which is the ID of the items that are being displayed.

 

Displaying all the data and having the submit buttons isnt the problem.  The problem is clicking the button.  I'm not sure how to manage the data at the end.  At the moment I have:

 

if(isset($_POST['buy'])) {

$w = $_POST['equipment'];

 

and then i want this to do an "insert into" on a different table with the id of "equipment" and the id of the user (which is stored in the session).

 

The database syntax works coz i tested it, but what to type after the:

if(isset($_POST['buy'])) {

 

just loses me.

 

Any help would be greatly appreciated!

thanks.

Goose.

Link to comment
https://forums.phpfreaks.com/topic/61963-multiple-submit-buttons-on-one-page/
Share on other sites

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.