Reply to topic
cfscript and database
Ennio


Joined: 17 Nov 2006
Posts: 98
Location: Scotch Plains, NJ
Reply with quote
How can I do an Insert to my DB inside of a <cfscript>
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 547
Location: Harrisburg, PA
Reply with quote
Not sure it's worth doing.. I much rather prefer a simple <cfquery> But here you go. This should work.. I hardly ever use CFScript. It's been shown and proven (I think) to not be any faster than standard CFML in versions 6+.

Code:

<CFSCRIPT>
  SQLString = "Select * From Products where ProductID = 52112";
  DATASOURCE = "CompanyInfo";
  checkUser=CFQUERY(SQLString: SQLString, DATASOURCE: DATASOURCE);
 
if (checkUser.recordCount neq 0) {
    CFOUTPUT("query returned" & checkUser.recordcount);
  } else {
    CFOUTPUT("no results returned");
  }
</CFSCRIPT>
Ennio


Joined: 17 Nov 2006
Posts: 98
Location: Scotch Plains, NJ
Reply with quote
Thank you... well I never used <cfscript> for DB but I'm fixing some bug on someone else code and they did some of the code using <cfscript>
cfscript and database
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic