Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

multiples forms in single database table

hi,

i am newbie for php mysql, i have google it but didnt found the solutions. i have 5 pages of forms with different field, i need to add all forms data into single column. But i dont want to use php session script. User fill the complete form or incomplete forms i will get the result as a lead. if any coder can help for that i will to pay some bucks too.

thanks
Do you mean the entire form is 5 page long or is your form situated on 5 different pages, thus having 5 different forms, but you want to put the results of these 5 forms into one column?
If the first, I'd suggest putting all the form fields into an associative array and store it in JSON format (look up json_encode and json_decode).
If the second... well you won't be able to properly do it without session. You can use mysqli_stmt_insert_id or PDO::lastInsertId after inserting the first form into the database, then pass the ID on from form to form in a hidden input field or in a cookie, but both can be manipulated, thus is prone to exploits (overwriting older records, etc.), so if the second thing is the case, then using sessions is a MUST.
PS: if you want this whole thing written for you, you have to go to the Marketplace section and post this topic there. Or you can enter "multi page form php" into google and start discovering the wonderful world of PHP for yourself!
You see, Doctor, God didn't kill that little girl. Fate didn't butcher her and destiny didn't feed her to those dogs.
If God saw what any of us did that night he didn't seem to mind. From then on I knew... God doesn't make the world this way.
We do.
See! First of all you have to tell how you are navigating to another page. If these are 5 different forms then its a easy task. I hope you know how to open and write a file using PHP. Another option is You have to use a single session or cookie with array or JSON.
Last but MOST IMPORTANT - Always remember, a single column of MySQL can not have more than 64 fields. Let me know if you need any extra help.
(Feb 20, 2020 12:32 PM)AevanParker Wrote:  See! First of all you have to tell how you are navigating to another page. If these are 5 different forms then its a easy task. I hope you know how to open and write a file using PHP. Another option is You have to use a single session or cookie with array or JSON.
Last but MOST IMPORTANT - Always remember, a single column of MySQL can not have more than 64 fields. Let me know if you need any extra help.
Why would you write to a file for this task, or use cookies to store the form information? Additionally, a column is one "field", and if you meant to say row, I don't see where the 64 column limit is coming from.

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.
(Feb 20, 2020 12:54 PM)Nachfolger Wrote:  Why would you write to a file for this task, or use cookies to store the form information? Additionally, a column is one "field", and if you meant to say row, I don't see where the 64 column limit is coming from.

Hi Nachfolger

I suggested him file because does not want to use session script. And yes I meant row. You can try this. In one row there can't be more than 64 fields. 64 is a magic number in PHP. column or table or db name also have a limitation of 64 character.
(Feb 20, 2020 12:58 PM)AevanParker Wrote:  Hi Nachfolger

[...] In one row there can't be more than 64 fields. 64 is a magic number in PHP. column or table or db name also have a limitation of 64 character.
So are you referring to the column name character limit of 64 or a limit of 64 columns in a table? You keep saying fields, which makes no sense imo.

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.
Op you’re making this 6x harder than it has to be. Consider scraping this horrible plan and do it differently.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by EffexionAug 2, 2019 03:04 PM 5 212 Aug 2, 2019 03:04 PM
Last Post: Nachfolger
[PHP] by QRCodeOct 28, 2018 10:45 AM 6 242 Oct 28, 2018 10:45 AM
Last Post: Abruptum
[PHP] by FaberCastellApr 6, 2018 09:50 AM 3 167 Apr 6, 2018 09:50 AM
Last Post: Eagle 95