php - how to insert in a table like shown in this image where tusername is come from previous page -


I have a page where I send it to Tuenza and found on page 2 where a form is formed. I want to add more than one data to the table using that form. Where the id is requested and the sub-code is entered by the table, it will save the data like this.

  & lt ;? Includes php ("db.php"); $ Tusername = $ _ Request ['tusername']; Update in values ​​('$ sub_code', '$ tusername'), in 'TechSub' (subcoda, tusname), where tusername = '$ tusername');? & Gt; & lt; html & gt; LT; body & gt; form method = "post" & gt; subject one: input type = "text" name = "subcode" & gt; & lt; br & gt; subject two: & lt; ; Input Type = "Text" name = "subcode"> <3> topic three:  

subject Four: input type = "text" name = "subcode">
input type = "submit" value = "ass In ">

I think it can help you

  include? Php (" db.php "); // if If the form is submitted then take the exam (isset ($ _ POST ['submit'])) {// form has been submitted $ tusername = $ _ request ['tusername']; Foreign currency ($ _ POST [ 'Sub_code'] as $ sub_code} {// Enter your data @ mescal_query (values ​​in 'texasub' (subcode, tusname), values ​​in the values ​​('$ sub_code', '$ tusername') Where tusername = '$ tusername' "); }} Other {// form not posted}? & Gt; & Lt; Form id = "form1" action = "& lt ;? php echo $ _SERVER ['PHP_SELF'] ;? & gt;" Method = "post" & gt; Topic one: & lt; Input type = "text" name = "subcode [1]" & gt; & Lt; Br> Give topic: & lt; Input type = "text" name = "subcode [2]" & gt; & Lt; Br> Subject three: & lt; Input type = "text" name = "subcode [3]" & gt; & Lt; Br> Subject four: & lt; Input type = "text" name = "subcode [4]" & gt; & Lt; Br> & Lt; Input type = "hidden" name = "submit check" value = "assign" & gt; & Lt; Input type = "submit" name = "form1 subsystem" & gt; & Lt; / Form & gt;  

Comments