My boss wants me to use cfscript instead of tags to interact with the database. Does anyone know of good textbooks? I bought an Adobe ColdFusion application development book, volume 2. But it has very little scripting. I did google and found this site , but that didn’t explain much.
Does any authority know about any good tutorials on accessing a database in CFScript?
Basically I need to convert the following to using CFScript:
<cfquery name="drafts" datasource="ICEchat"> SELECT * from Messages where IsTemp=1 and LinkA=#FORM.LinkA# and LinkB=#FORM.LinkA# </cfquery> <cfif drafts.recordcount GT '0'> <cfquery name="Attachments" datasource="ICEchat"> SELECT * FROM Attachments where id=2 </cfquery> { Message:"<cfoutput query="drafts">#Message#</cfoutput>", Attachments:[<cfoutput query="attachments"> "#url#"<cfif attachments.currentRow LT attachments.recordcount>,</cfif> </cfoutput>]} <cfelse> <cfquery name="addrecord" datasource="ICEchat"> INSERT INTO Messages VALUES(1,1,' ',1) </cfquery> { Message:"NA", Attachments:[]} </cfif>
coldfusion
Ted pottel
source share