Hi everyone,
I'm possibly being very slow here but web dev isn't something i've done much/any of...
The aim is to try and get 2 text box inputs to be written to a database when a button is clicked.
this creates a page, that is a table of 4 columns from left to right being, name, StringValue(as an input), IntValue(as an input), and an update button. so when clicked this should get the 2 inpouts and insert them into the database.
Hope this makes sense^^
Thanks in advance for any help!
I'm possibly being very slow here but web dev isn't something i've done much/any of...
The aim is to try and get 2 text box inputs to be written to a database when a button is clicked.
B4X:
Dim tabParam As ResultSet = Main.IntSQL.ExecQuery("SELECT * FROM TabletParameters;")
Dim tabint As Int
tabint = 0
resp.Write("<Form>")
resp.Write("<table style='width:100%'>")
resp.Write("<tr>")
resp.Write("<td style='width:25%'><b>Parameter</b></td>")
resp.Write("<td style='width:25%'><b>StringValue</b></td>")
resp.Write("<td style='width:25%'><b>IntValue</b></td>")
resp.Write("<td style='width:25%'><b>Change</b></td>")
resp.Write("</tr>")
Do While tabParam.nextrow
resp.Write("<tr>")
resp.Write("<td style='width:25%'>" & tabParam.GetString("Param") & "</td>")
resp.Write("<td style='width:25%'><input type='text' name='StringValue" & tabint & "' value='" & tabParam.GetString("StringValue") & "'></td>")
resp.Write("<td style='width:25%'><input type='number' name='IntValue" & tabint & "' value='" & tabParam.GetString("IntValue") & "'></td>")
resp.Write("<td style='width:25%'><a href='http://" & Main.myLocalIP & ":8888/DataTable?DatabaseName=IntSQL&DataTableName=TabletParameters'" & Main.IntSQL.ExecNonQuery("INSERT INTO TabletParameters(StringValue, IntValue)VALUES(" & StringValue & ", " & IntValue & ")") & "> <button type='button' value='Change'>change " & tabParam.GetString("Param") & "</button></a></td>")
resp.Write("</tr>")
' & tabParam.GetString("Params") &
tabint = tabint + 1
Loop
resp.Write("</table>")
'resp.Write("<input type='submit'/>")
resp.Write("</form>")
Hope this makes sense^^
Thanks in advance for any help!