2 Replies Latest reply on Oct 21, 2011 1:35 AM by Siner zxazxa

    CFScript call to database not working.

    Gene Godsey Level 1

      Here is the code:

      ----------------------------

       

      <html>

      <head>

      <title>Chapter 3 - CFScript functions</title>

      </head>

      <body>

      <cfscript>

       

      myQuery = New Query();

      myQuery.setDatasource("cfartgallery");

      myQuery.setSQL("SELECT * FROM ARTISTS");

      Artist = myQuery.Execute();

      writedump(Artist);

       

      /*

      myMail = New Mail();

      myMail.setAttributes({

        to = "someone@gmail.com",

        from = "dick.tracy@somewhere.net",

        subject = "This is a test Subject",

        body = "This is a test Message!"

      });

      myMail.Send();

      */

      </cfscript>

      </body>

      </html>

       

      ---------------------------

      Error:

      ---------------------------

      The web site you are accessing has experienced an unexpected error.
      Please contact the website administrator.

      The following information is meant for the website developer for debugging purposes. 

      Error Occurred While Processing Request 
      Invalid CFML construct found on line 66 at column 49. 
      ColdFusion was looking at the following text:
      for

      The CFML compiler was processing:

      A script statement beginning with for on line 66, column 49.
      A script statement beginning with { on line 64, column 33.
      A script statement beginning with if on line 63, column 33.
      A script statement beginning with { on line 61, column 25.
      A script statement beginning with if on line 60, column 25.
      A script statement beginning with public on line 58, column 17.
      A cfscript tag beginning on line 19, column 6.

       
      The error occurred in C:\ColdFusion9\CustomTags\com\adobe\coldfusion\base.cfc: line 66

      64 :     {
      65 :       //include only relevant properties
      66 :       for(var p in arguments["1"])
      67 :       {
      68 :        if(listcontainsnocase(variables.tagAttributes,p)){

       

       

      ---------------------------