Jump to content

Recommended Posts

I have a long form that I need to break up into 4 differant html pages, and they all need to be submitted to the same table in the same DB.

I use POST scripts to pull information from the form and convert them to variables,

then I run a sql script that enters the vars into my database

[code=php:0]
$sql = "INSERT INTO joborder VALUES (NULL, '$usedbefore', '$nearestlocation', '$companyname', '$firstname', '$lastname', '$department', '$phone', '$fax', '$email', '$address', '$addresstwo', '$city', '$state', '$country', '$zip', '$positiontype', '$dressreq', '$dresscode',  '$positionclassification', '$positiontitle', '$employeesneeded', '$timeneeded', '$startdate', '$workinghours', '$workAddress', '$workaddresstwo', '$workcity', '$workstate', '$workzip', '$positiondescription', '$skillsrequired', '$educationrequired', '$additionalrequirements', '$checkedby', '$hourlyrate', SYSDATE(), '$reportto')";
mysql_query($sql) or die ( mysql_error() );
[/code]

The reason for the overly huge database is that we already have a search developed that searches on differant colomns on this DB,

anyway, if the form is split up into 4 pages, how do i submit information into the same table in sections without losing any information on other pages. I have a few ideas, but they all seem shadey. So hopefuly some one out there has done this before and can point me in the right direction.
Link to comment
https://forums.phpfreaks.com/topic/17947-multi-page-form/
Share on other sites

There are a few ways to do this, but the way I normally do it is to allow nulls in your columns, other than the ID column.  Then you just run update statements on the parts of the table that you're updating.

So on the first page, you insert the record with only the parts from the first form.  On the next 3 forms, all you do is run an UPDATE statement with only the new fields.

Does that make sense?
Link to comment
https://forums.phpfreaks.com/topic/17947-multi-page-form/#findComment-76769
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.