7 Replies Latest reply on May 4, 2008 12:51 AM by (Iain_MacDonald)

    Error creating temporary table

    Level 1
      Am new to ADDT, and just trying it out. Just followed the wizard through for an Insert Record, but am just getting an error message on the page :

      http://www.pixelar.co.uk/admin/addnew.php

      I've put up the code as a text file here :

      http://www.pixelar.co.uk/insertrecord.rtf

      Any help much appreciated - I thought I'd get a bit further than this before running into issues!
        • 1. Re: Error creating temporary table
          Günter Schenk Level 4
          Hi Iain,

          I see you have named one column "MP1-3" -- hyphens as well as other special characters are forbidden in MySQL column names. The only allowed special char would be an underscore, so please with renaming the column to MP1_3.

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Error creating temporary table
            Level 1
            Cheers for that - I'd started rebuilding it with fewer fields, and it seemed fine, so I figured it might be a special character issue.

            I also realised where I was going wrong with uploading files - am I right in thinking I should create the insert new record form in a page as step one, and then apply any file upload behaviours?

            Also, do you know if it's possible to change the value of a Y/N checkbox to display as 'Yes' rather than just 'Y'?
            • 3. Re: Error creating temporary table
              Günter Schenk Level 4
              Hi Iain,

              ----
              am I right in thinking I should create the insert new record form in a page as step one, and then apply any file upload behaviours?
              ----

              yes, because implementing a File Upload behaviour will only work when the page in question already has an Insert or Update Record behaviour defined.

              ----
              Also, do you know if it's possible to change the value of a Y/N checkbox to display as 'Yes' rather than just 'Y'?
              ----

              here´s my long-winded reply: depends :-)

              Checkbox values are getting submitted to the database as Y/N or 1/0 on principle, and there´s no way to change that -- however it´s possible to display the Y value in a different way on whatever page. It´s that what you mean ?

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Error creating temporary table
                Level 1
                The file upload thing - that's what I'd come to think. I think when I first installed ADDT I thought the options that appear in the panel at the top were all the options, but in fact there are several more accessible via the server behaviours panel. <br /> <br />The checkbox value thing - yes, literally just to display 'Yes' rather than just 'Y' on any page - I thought maybe I just had to change the value in the code : <br /> <br /> <br /> <br /> <br /> <br /> <br />here from 'Y' to 'Yes', but that didn't seem to work. <br /> <br />How would I go about that? <table> <tr> <td class="KT_th"> <label for="JPEG">JPEG:</label> </td> <td> <input <?php if (!(strcmp(KT_escapeAttribute($row_rsphotoframes['JPEG']),"Y"))) {echo "checked";} ?> type="checkbox" name="JPEG" id="JPEG" value="Y" /> <br /> <?php echo $tNGs->displayFieldError("photoframes", "JPEG"); ?></td> </tr> </table>
                • 5. Re: Error creating temporary table
                  Günter Schenk Level 4
                  -----
                  The checkbox value thing - yes, literally just to display 'Yes' rather than just 'Y' on any page
                  ------

                  that´s where ADDT´s "Show IF Conditional Region" behaviour comes into play:

                  1. type Yes and highlight it

                  2. open the "Show IF Conditional Region" behaviour from the Server Behaviours menu

                  3. Expression 1: select the recordset´s column which holds the Y/N value

                  4. Condition: == (aka equals)

                  5. Expression 2: type "Y" in here (without the quotes)

                  6. optionally: tick the "has Else" checkbox

                  7. confirm with OK

                  This behaviour will actually add a standard PHP IF statement to your page, where the previously highlighted text "Yes" will be displayed when the columns´value equals "Y" -- and the "has Else" option will add an ELSE statement below for displaying an alternate text if the column´s value doe snot equal "Y" (probably the N value)

                  -----
                  I thought maybe I just had to change the value in the code
                  -----

                  better don´t do that ;-)

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Error creating temporary table
                    Level 1
                    OK - makes sense, if a bit of a long road for a shortcut!

                    On my edit record page, I just usually change the value in the value="" part - I'd have thought that was kinda what it was for?

                    Anyway - with the show... if... thing - where exactly should I be typing 'Yes'?
                    • 7. Re: Error creating temporary table
                      Level 1
                      Sorry - just got that -

                      // Show IF Conditional region1
                      if (@$row_WADAphotoframes['JPEG'] == "Y") {
                      ?>
                      Yes
                      // endif Conditional region1
                      ?>

                      Instead of :