![]() |
|
[PHP] multiples forms in single database table - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] multiples forms in single database table (/showthread.php?tid=6050800) |
multiples forms in single database table - adwareinc-com - Feb 19, 2020 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 RE: multiples forms in single database table - Squito - Feb 19, 2020 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! RE: multiples forms in single database table - AevanParker - Feb 20, 2020 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. RE: multiples forms in single database table - Nachfolger - Feb 20, 2020 (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.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. RE: multiples forms in single database table - AevanParker - Feb 20, 2020 (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. RE: multiples forms in single database table - Nachfolger - Feb 20, 2020 (Feb 20, 2020 12:58 PM)AevanParker Wrote: Hi NachfolgerSo 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. RE: multiples forms in single database table - Charger - Feb 20, 2020 Op you’re making this 6x harder than it has to be. Consider scraping this horrible plan and do it differently. |