Jump to content

table data fields to email


refael

Recommended Posts

Hi everyone,

 

As a newbie in php I am quite familiar how to submit a bunch of form input fields to an email (form to email).

 

Here is something I am struggling with:

 

I have a table where the data in the fields are injected (spared) from a database.

You see, the table is an actual php code that generates the rows/columns using “for each loop” so the fields name or ID are the same in each row.

 

So I have several rows where each row ends with a “submit” button.

What I need to do is once the user click the submit button in a certain row to submit the data to an email.

I know how to write the code but how I can determine which filed ID or name to collect as they are all the same?

I am not sure how can I collect the fields only from a certain row to an email?

Can someone help me understand how to do it? Many many Thanks!

Link to comment
https://forums.phpfreaks.com/topic/178886-table-data-fields-to-email/
Share on other sites

since you didn't actually post any code, this is just a guess...you probably have something like this:

 

while($row=mysql_fetch_.....) {
  ...name="blah[]"...
}

 

Key thing there is that you just have [] for it to auto-generate the next element.  Instead of doing that, put the id in there:

 

blah[$row['id']]

 

then when user presses the submit button, you will know which id to query for based off the key in blah

 

 

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.