Problem in using INSERT in MySQL database
Posted: Thu May 04, 2006 11:06 am
Hello,
I have problem in using INSERT in MySQL database.
It works for string and constant:
put "INSERT INTO table_name (field1, field2) VALUES ('Peter', 35)" into theSQL
However when I use variables like the following, it does not work:
Put "Peter" into tname
Put "35" into tage
put "INSERT INTO table_name (field1, field2) VALUES (tname, tage)" into theSQL
The query is success. However no data is inserted into the table.
Please help!
Thanks and best regards
I have problem in using INSERT in MySQL database.
It works for string and constant:
put "INSERT INTO table_name (field1, field2) VALUES ('Peter', 35)" into theSQL
However when I use variables like the following, it does not work:
Put "Peter" into tname
Put "35" into tage
put "INSERT INTO table_name (field1, field2) VALUES (tname, tage)" into theSQL
The query is success. However no data is inserted into the table.
Please help!
Thanks and best regards