Question
Once again: Does MySQL allow multiple querys in one database transaction???
Hello to ALL!!!
The problem is:
I'm trying to make simple query (database: "myDB" (engine: myisam/innodb - doesn't mater) with one table: "Info" with two columns: "Id" (autoinc), "info_c" (varchar):
<cfif structkeyexists (form, "name")>
<cfquery datasource="myDB" name="qDB" >
INSERT into Info (info_c)
VALUES ('#form.name#');
SELECT @@identity AS Id
</cfquery>
</cfif>
<cfform>
<cfinput type="text" name="name">
<cfinput type="submit" name="submit">
</cfform>
BUT after "Submit" I get:
Error Executing Database Query.
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 '; select @@identity as Id' at line 2
Please, tell me WHY???
I have:
MySQL
Server information:
MySQL version: MySQL 5.1.25-rc-community via TCP/IP
Clent Information:
Version: MySQL client version 5.1.11
Coldfusion Version Information:
Version 8,0,0,176276
Great THANKS for your answers!!!
The problem is:
I'm trying to make simple query (database: "myDB" (engine: myisam/innodb - doesn't mater) with one table: "Info" with two columns: "Id" (autoinc), "info_c" (varchar):
<cfif structkeyexists (form, "name")>
<cfquery datasource="myDB" name="qDB" >
INSERT into Info (info_c)
VALUES ('#form.name#');
SELECT @@identity AS Id
</cfquery>
</cfif>
<cfform>
<cfinput type="text" name="name">
<cfinput type="submit" name="submit">
</cfform>
BUT after "Submit" I get:
Error Executing Database Query.
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 '; select @@identity as Id' at line 2
Please, tell me WHY???
I have:
MySQL
Server information:
MySQL version: MySQL 5.1.25-rc-community via TCP/IP
Clent Information:
Version: MySQL client version 5.1.11
Coldfusion Version Information:
Version 8,0,0,176276
Great THANKS for your answers!!!
