Simple .lc Script to INSERT data...?

JOHN PATTEN johnpatten at me.com
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 "http://username.on-rev.com/ipad_1/add_data_2.lc"
end mouseUp


My .lc file looks like this:

<?lc
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"
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
SUSD




More information about the use-livecode mailing list