Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Neopolita #1
Dynamic insert query problem.
Why is not working?
Thanks.
<cffunction
name="InsertRow"
hint="Insert a row in the table"
access="remote" returnType="query" >
<cfargument name="login" type="string" required="true">
<cfargument name="pass" type="string" required="true">
<cfargument name="tableName" type="string" required="true">
<cfargument name="arrayfieldnames" type="array" required="true">
<cfargument name="arrayfieldvalues" type="array" required="true">
<cfquery name="InsertRow" datasource="intiridesigns_db"
username=#login# password=#pass#>
INSERT INTO #tableName# (<cfloop from="1"
to="#arraylen(arrayfieldnames)#" index="a">#arrayfieldnames[a]#<CFIf a
NEQ arraylen(arrayfieldnames)>,</CFIf></cfloop>) VALUES (<cfloop
from="1" to="#arraylen(arrayfieldvalues)#"
index="a">'#arrayfieldvalues[a]#'<CFIf a NEQ
arraylen(arrayfieldvalues)>,</CFIf></cfloop>)
</cfquery>
<cfreturn InsertRow>
</cffunction>
Neopolita Guest
-
Problem with Dynamic Update Query
I am having a problem with a dynamic query I create a string which will be inserted into the Query tag <cfQuery> Update Table Set #MyVar#... -
Insert record from dynamic form problem
XP Pro, CF 6.1(built in webserver), MySQL 4.1.13, DW MX04, I am trying to insert a records from a dynamic form. I created it all in Dreamweaver MX... -
Dynamic Query Problem
I am using CF 5 and would like to create a dynamic query on a table based on 4 form variables. For example, if only two out of the 4 form... -
mulitple query insert problem
Ben. I am doing the scenario where the id key is auto generated from Access. I know I need to get that id to do the second insert into the... -
SQL Insert Query using ADO
Hi, I am sending an SQL Insert query to my ADO connection object, my Insert query looks a litte like this... INSERT INTO tblRequests...



Reply With Quote

