email form array that pulls info from database record

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
longbo43
Forum Newbie
Posts: 10
Joined: Tue Apr 20, 2010 2:33 am

email form array that pulls info from database record

Post by longbo43 »

Hi folks.

Newbie here so please bear with me if this is a bit simple for you but is really complicated for me.

I have a MySQL database that I have created a web form in php for users to enter information relatnig to a meeting request with specific targets. Each time a record is crated the MySQL database assigns a meeting ID (from an autonumber field in the record).
Once the user completes the form they click a button to do a couple of things. 1. create an email that popultaes all the information they have entered into the form into the body of the email. 2. Save the array into the database.
No. 2 works fine and the array creates a record and is assigned a meeting ID. My problem is the email. Everything pastes into the body and the subject line populalates with info from the data that was entered. The only thing that is not on the email is the Meeting ID. This is because the Meeting ID is not assigned till after the email is sent.

Has anyone done anything like this before or able to help me out. Please feel free to ask questions or if necessary I can post the code.

Cheers for any help.
cerberusstudios
Forum Newbie
Posts: 7
Joined: Tue Apr 20, 2010 2:39 am

Re: email form array that pulls info from database record

Post by cerberusstudios »

I am sorry if I understood your question. Please tell me if I am missing anything. But I think you can just change the order of operations to your site to:

1. Gather information
2. Write to database
3. Retrieve Meeting ID
4. Send email
longbo43
Forum Newbie
Posts: 10
Joined: Tue Apr 20, 2010 2:33 am

Re: email form array that pulls info from database record

Post by longbo43 »

Hi Thanks for your reply.

Would that mean I have to change the email settings to after event?

If that is so how can I be sure that the php would pick up the array of information that was submitted by that user.

What I mean is what happens if 2 people submit there information at almost the same time but one has a slower internet connection than the other. Is there a way of making sure it picks the correct record.

Again any help is most appreciated.
cerberusstudios
Forum Newbie
Posts: 7
Joined: Tue Apr 20, 2010 2:39 am

Re: email form array that pulls info from database record

Post by cerberusstudios »

If your table has a foreign key such as a user id that would make it easy to compare the user id with some of the other information from your array.

If you do not have any information that is unique or foreign keys you may have to take the auto_increment out and increment the number yourself to make sure to get the correct ID.

I would suggest to keep the auto_increment and make sure that your table has unique information in it that you are able to compare to.
Post Reply