Simple .lc Script to INSERT data...?
johnpatten at me.com
Fri Jun 5 18:31:12 EDT 2015
I must be missing something simple and I can’t find it…
I have a mysql database with one table and one field. Varchar(1000)
I have a LiveCode project with one button and the following code:
put urlEncode(the name of target) into tName
put "object_name=" & tName into ArgList
post tArgList to URL "http://username.on-rev.com/ipad_1/add_data_2.lc"
My .lc file looks like this:
put revOpenDatabase ("mysql”,"username.on-rev.com”,"username_ipad_2”,"username_ipad_2”,"password") into tConID
put "ipad_data" into tTableName
put $_GET["object_name"] into object_name
put "object_name" into tFields
put "INSERT INTO" && tTableName && "(" & tFields & ") VALUES (:1);" into tSQL
revExecuteSQL tConID, tSQL, "object_name"
The .lc script creates a new record but it never puts the name of the button in the object_name field? The record is completely empty. I was having the same problem on a much more complex database and script, so I thought I would super simplify but I’m still having the problem.
Does anybody see anything I’m missing?
More information about the Use-livecode