Simple .lc Script to INSERT data...?

JOHN PATTEN johnpatten at
Fri Jun 5 18:31:12 EDT 2015

Hi All,

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:

on mouseUp
   put urlEncode(the name of target) into tName
   put "object_name=" & tName into ArgList
   --answer ArgList
   post tArgList to URL ""
end mouseUp

My .lc file looks like this:

put revOpenDatabase ("mysql”,"”,"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"
revCloseDatabase tConID
put empty

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?

Thank you!
 John Patten

More information about the Use-livecode mailing list