Page 1 of 1

adding data to a mysql table using zeos database on Kylix 3

Posted: 24.08.2005, 06:13
by windy
Hi
great to see a forum, good work guys :)
NOw, I am using zeos databsase on kylix 3
I can successfully login into a mysql server
good
and i can set to use the table needed
but I am not sure of how to add records to the table....
i see you have some very brief examples in the FAQ seciton of this forum...
can you exapnd on those snippets, i.e just a simple code snippet to update a table (where you know the fields. i.e you add data to each field in the table (i guess using the batch command)
thanks very much!!!
Brian
Ps, how can I make a paypal donation to the cause?
thanks!

Posted: 07.09.2005, 07:20
by wserg
Hi,

Very easy.
i.e, you have placed on form ZBatchSQL component and called it as dbSQL. In order to insert new record just set SQL property to 'INSERT INTO table SET f1='', f2=''' and so on.

If you want to update an existing record/records set SQL property to
'UPDATE table SET f1='' WHERE keyf1='''

To execute your SQL statement you can by dbSQL.ExecSQL

Hope it helps.