5 Replies Latest reply on Jun 19, 2007 1:41 AM by (ionut_moicianu)

    Fake Recordset Issue

      I get an error that states: Error:
      Internal error.
      Developer Details:
      tNG_fields.getFakeRecordset:
      SQL error: Error creating temporary table:
      You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TEXT)' at line 1

      Why is this happening? I have full permissions in the database and this occurs when loading the page after puting in an insert form through the developer toolbox. I have another form set up the same way for another site that works fine.
        • 1. Re: Fake Recordset Issue
          Sometimes the code gets added to the page in the wrong order. For
          example, the calls to the include files are further down the page than
          they should be - and calls to functions are higher up and fire before
          the include files are loaded. Take a look at the code and compare it to
          a similar working page. Make sure the include files are loaded before
          any function calls. That might not be YOUR problem, but it is A problem
          I've had to adjust manually many times. It's the first thing I'd check.


          --
          Alec Fehl, MCSE, A+, ACE, ACI
          Adobe Community Expert

          AUTHOR:
          Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
          Publications)
          Welcome to Web Design and HTML (Labyrinth Publications)

          CO-AUTHOR:
          Microsoft Office 2007: Essentials (Labyrinth Publications)
          Computer Concepts and Vista (Labyrinth Publications)
          Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
          Internet Systems and Applications (EMC Paradigm)
          • 2. Re: Fake Recordset Issue
            Level 1
            s best I can tell both files are pretty closely ordered. I've even opened new documents and tried to create the form again. Any other thoughts? Here's the code for the page I've been testing:



            // Load the tNG classes
            require_once('includes/tng/tNG.inc.php');

            // Make a transaction dispatcher instance
            $tNGs = new tNG_dispatcher("");

            // Make unified connection variable
            $conn_grindoff = new KT_connection($grindoff, $database_grindoff);

            // Start trigger
            $formValidation = new tNG_FormValidation();
            $tNGs->prepareValidation($formValidation);
            // End trigger

            // Make an insert transaction instance
            $ins_company = new tNG_insert($conn_grindoff);
            $tNGs->addTransaction($ins_company);
            // Register triggers
            $ins_company->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");
            $ins_company->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);
            // Add columns
            $ins_company->setTable("company");
            $ins_company->addColumn("company_name", "STRING_TYPE", "POST", "company_name");
            $ins_company->addColumn("total_score", "NUMERIC_TYPE", "POST", "total_score");
            $ins_company->addColumn("tpay_score", "NUMERIC_TYPE", "POST", "tpay_score");
            $ins_company->addColumn("tperk_score", "NUMERIC_TYPE", "POST", "tperk_score");
            $ins_company->addColumn("tculture_score", "NUMERIC_TYPE", "POST", "tculture_score");
            $ins_company->addColumn("tpolitics_score", "NUMERIC_TYPE", "POST", "tpolitics_score");
            $ins_company->addColumn("tleader_score", "NUMERIC_TYPE", "POST", "tleader_score");
            $ins_company->addColumn("tdevel_score", "NUMERIC_TYPE", "POST", "tdevel_score");
            $ins_company->addColumn("tbenefits_score", "NUMERIC_TYPE", "POST", "tbenefits_score");
            $ins_company->setPrimaryKey("primary", "NUMERIC_TYPE");

            // Execute all the registered transactions
            $tNGs->executeTransactions();

            // Get the transaction recordset
            $rscompany = $tNGs->getRecordset("company");
            $row_rscompany = mysql_fetch_assoc($rscompany);
            $totalRows_rscompany = mysql_num_rows($rscompany);
            ?>

            getErrorMsg();
            ?>
            ">


            Company_name:
            " size="32" />
            displayFieldHint("company_name");?> displayFieldError("company", "company_name"); ?>



            Total_score:
            " size="32" />
            displayFieldHint("total_score");?> displayFieldError("company", "total_score"); ?>



            Tpay_score:
            " size="32" />
            displayFieldHint("tpay_score");?> displayFieldError("company", "tpay_score"); ?>



            Tperk_score:
            " size="32" />
            displayFieldHint("tperk_score");?> displayFieldError("company", "tperk_score"); ?>



            Tculture_score:
            " size="32" />
            displayFieldHint("tculture_score");?> displayFieldError("company", "tculture_score"); ?>



            Tpolitics_score:
            " size="32" />
            displayFieldHint("tpolitics_score");?> displayFieldError("company", "tpolitics_score"); ?>



            Tleader_score:
            " size="32" />
            displayFieldHint("tleader_score");?> displayFieldError("company", "tleader_score"); ?>



            Tdevel_score:
            " size="32" />
            displayFieldHint("tdevel_score");?> displayFieldError("company", "tdevel_score"); ?>



            Tbenefits_score:
            " size="32" />
            displayFieldHint("tbenefits_score");?> displayFieldError("company", "tbenefits_score"); ?>
            • 3. Re: Fake Recordset Issue
              Level 1
              The order of the includes look fine. 2 other things to check:
              1] Upload the includes folder to the server again - just to be sure
              everything is there
              2] Check with the web host on that Create Temporary Tables privilege.
              I've had many issues with hosts saying this was done - but the user
              didn't really have the privilege

              --
              Alec Fehl, MCSE, A+, ACE, ACI
              Adobe Community Expert

              AUTHOR:
              Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
              Publications)
              Welcome to Web Design and HTML (Labyrinth Publications)

              CO-AUTHOR:
              Microsoft Office 2007: Essentials (Labyrinth Publications)
              Computer Concepts and Vista (Labyrinth Publications)
              Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
              Internet Systems and Applications (EMC Paradigm)
              • 4. Re: Fake Recordset Issue
                Level 1
                I tried both options and apparently neither is the issue. Here is the full error returned when the site loads in case it provides more details. This is driving me crazy!

                Error:
                Internal error.
                Developer Details:
                tNG_fields.getFakeRecordset:
                SQL error: Error creating temporary table:
                You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TEXT)' at line 1
                SQL:
                CREATE TEMPORARY TABLE KT_fakeRS_20070607 (company_name TEXT, total_score TEXT, tpay_score TEXT, tperk_score TEXT, tculture_score TEXT, tpolitics_score TEXT, tleader_score TEXT, tdevel_score TEXT, tbenefits_score TEXT, primary TEXT) (FIELDS_FAKE_RS_ERROR)
                tNG Execution Trace - VIEW
                tNG_insert.executeTransaction
                STARTER.Trigger_Default_Starter
                tNG_insert.getRecordset
                tNG_insert.getLocalRecordset
                tNG_insert.getFakeRecordset*
                • 5. Re: Fake Recordset Issue
                  Level 1
                  Hello,

                  The problem is that you have a table column named "primary", which is an SQL reserved word. You need to change this to something else.

                  regards,
                  Ionut