Page 1 of 1

data insertion using fnx basic into mysql

Posted: Mon Oct 15, 2007 9:32 am
by necmigulen
well [ch305] have seen mysql example ;
     there is / db.query("INSERT INTO mytable (name,zipcode,address) VALUES(`john`,`1234`,`bublestreet`)") to insert values into
mysql table  .
How can [ch305] insert form textbox value into these query.
               

data insertion using fnx basic into mysql

Posted: Tue Oct 16, 2007 9:22 pm
by Marco
Hi,

the db.query is the mysql command in a string:
db.query(string)
dim a as string
dim name as string,zip as string,address as string
name=edit.text ``etc

So you can construct a string with the mysql commands, with this one it looks like this:

a="INSERT INTO mytable (name,zipcode,address) VALUES(`"
a=a+name+"``,``"
a=a+zip+"`,`"
a=a+address+"`"

db.query(a)

Hope this will help, best regards