php - Fetch value from database into dynamically added row -


I'm new to PHP programming, now I'm making a program for billing system. The table is created and by adding the row dynamically to the table, it works fine. Now I want to add value to the database in the dynamically added row, please tell me how to add value. Here is my code form

  & lt; form style = "margin-left: 200px; padding: 10px; background: yellow; width: 500px;" Action = "bill.fp" method = "post" name = "transaction" id = "transaction" & gt; & Lt; Span style = "color: black" & gt; Receipt Number: & lt; / Span & gt; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Lt; Input type = "text" name = "no RCPT" id = "no RCPT" /> gt; & Lt; / Br & gt; & Lt; / Br & gt; & Lt; Label = "student name" & gt; & Lt; Span style = "color: black" & gt; Customer's Name: & lt; / Span & gt; & Lt; / Label & gt; & Lt; Select name = "st_name" id = "st_name" & gt; & Lt; Option value = "" & gt; Select ..  / Options & gt; & Lt; / Select & gt; & Lt; / Br & gt; & Lt; / Br & gt; & Lt; Label = "academic year" & gt; & Lt; Span style = "color: black" & gt; Academic year: & lt; / Span & gt; & Amp; Nbsp; & Amp; Nbsp; & Lt; / Labels & gt; & Lt; Select name = "arad_yyyyyyyyy" id = "arad_yure" & gt; & Lt; Option value = "" & gt; Select ..  / Options & gt; & Lt; / Select & gt; & Lt; / Br & gt; & Lt; / Br & gt; & Lt; label = "item name" & gt; & Lt; Span style = "color: black" & gt; Item name: & lt; / Span & gt; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; & Amp; Nbsp; ; & Amp; Nbsp; & Nbsp; & Nbsp; & Amp; Nbsp & lt; / Labels & gt; & Lt; Choose name = "item_name" id = "item_name" & gt; & Lt; Option value = "" & gt; Select ..  / Options & gt; & Lt; / Select & gt; & Lt; Input type = "button" name = "addItem" id = "addItem" value = "add item" /> & Lt; / Br & gt; & Lt; / Br & gt; & Lt ;! - & lt; Div id = "items1" & gt; & Lt; B & gt; & Lt; / B & gt; & Lt; / Div & gt; - & gt; & Lt; Table id = "item" limit = "2" width = "400px" cellpadding = "4" cellpaction = "1" & gt; & Lt; TR & gt; & Lt; -! & Lt; Th & gt; Sr.No. & lt; / Th & gt; - & gt; & Lt; Th & gt; Item name & lt; / Th & gt; & Lt; Th & gt; Unit cost & lt; / Th & gt; & Lt; Th & gt; Quantity & lt; / Th & gt; & Lt; Th & gt; Total & lt; / Th & gt; & Lt; / TR & gt; & Lt; Tbody & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Form & gt;   

and here JQUERY

  var cnt = 2; ($ ('($' '(' # AddItem ') Click' & lt; tr & gt; & lt; td & gt; '+ cnt +' & lt; / td & gt; Item tr '). Td>' + cnt + '& lt; / td> & lt; td & gt; & lt; input type = "text" name = "txtbx' + cnt + '" value = "'+ Cnt +'" "gt; & lt; / td> & lt; / tr & gt; '); cnt ++;});   

So please tell me, how can I add the data name and the dynamically added row to the unit price?

Thanks in advance.

I assume that you have the SQL database, what is this taste of SQL ?

In a way you can do that using an Ajax call to capture database information, and then use it in your dynamically created table.

Your Ajax might look like this:

  $ Ajax ({url: "http: // locationofyourdbhook",}) .done (function) {if (console & amp; console ('& lt; tr & gt; & lt; td & gt;' + data After cnt + ' & lt; TD & gt;' + data.cnt + '($ "' ('# item tr'). & Lt; / td & gt; & lt; Td> Input  & lt; / Tr>); cnt ++;}});    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -