Using Post tData?

Dave Cragg dave.cragg at lacscentre.co.uk
Mon Sep 23 18:03:16 EDT 2013


> But in a lc code stack with a button and two flds I get:
> "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
> 
> Button's script:  
> 
> on mouseUp
>   post cd fld 1 to URL "http://jpatten.on-rev.com/safetube_student/lc_lookup_list_exec_nc.php"
>   put it into cd fld 2
>   answer the result
> end mouseUp


John, are you entering just a number in card field 1? If so, the posted data won't be structured correctly. The data you post needs to be formatted like this:

doccode=19

So something like this:

put "doccode=" & cd fld 1 into tPostdata
post tPostdata to url "http://jpatten.on-rev.com/safetube_student/lc_lookup_list_exec_nc.php"

Or use libUrlFormData to format the data you are posting.

Cheers
Dave Cragg



More information about the use-livecode mailing list