dhtmlxConnector allows executing some actions against DB.
DBWrapper object can be accessed as:
<cfset conn.sql>
Then, it can be used in queries in the following way:
<cfset conn.sql.query("DELETE FROM some_table WHERE ID=1")>
//or
<cfset res=conn.sql.query("SELECT * FROM some_table WHERE ID=1")>
<cfset data=conn.sql.get_next(res)>
//or
<cfset conn.sql.query("INSERT INTO some_table(type) VALUES('simple')")>
<cfset id = conn.sql.get_new_id()>
<cfset param = structNew()>
<cfset param["value"] = '8898'>
<cfset param["name"] = 'new name'>
<cfset id = grid.do_insert(param)>
Parameters:
<cfset param = structNew()>
<cfset param["id"] = '8'>
<cfset param["value"] = '8898'>
<cfset param["name"] = 'new name'>
<cfset grid.do_update(param)>
Parameters:
<cfset grid.do_delete(id)>
Parameters:
You can create an extra connector object on the fly and use it for DB operations.
<cfset conn = createObject("component","dhtmlxConnectors.Connector").init(
"#datasource#",
"MySQL"
)>
<cfset conn.configure("some_table")>
<cfset param = structNew()>
<cfset param["value"] = '8898'>
<cfset param["name"] = 'new name'>
<cfset id = conn.do_insert(param)>
<cfset conn.do_delete("2")>
Back to top