8 Replies Latest reply on Sep 3, 2007 9:02 PM by (tomshen)

    urgent: 'del a record wizard' not working

      I am trying to create subscribe and unsubscribe email address function on our web due to new anti-spam law being introduced, which I am trying to comply. I use PHP and MySQL for this task.

      I got the subscribe users email address page working by using 'insert a new record wizard', I have 3 text fields for the page: first name, last name and email address (primary key). But I cannot get the unsubscribe page working, I think I need to use 'del a record wizard', is this correct? but the end result does not show any fields.

      PS: how do I stop duplicates emails being subscribed into the database? The subscribe page I created does not seem to check whether a email address has been added to the database before.

      Many thanks in advance,
        • 1. Re: urgent: 'del a record wizard' not working
          Günter Schenk Level 4
          Hi Tom,

          >>
          But I cannot get the unsubscribe page working, I think I need to use 'del a record wizard', is this correct?
          >>

          hmm, I think it depends on what you expect -- if the unsubscription is meant to delete the whole account, then yes. But if you rather prefer to have the account as such preserved, I´d suggest to add an extra "subscribed_flag" column ("char 1" and "NULL" for accepting Y/N checkbox values) to the user table and then set this column to 'N' on the "unsubscribe" page.

          >>
          how do I stop duplicates emails being subscribed into the database?
          >>

          Server Behaviours > Developer Toolbox > Form Validation > Check Unique Key -- try adding this behaviour to the form and make sure it checks the "email" column.

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: urgent: 'del a record wizard' not working
            Level 1
            Hi, Thank you for your reply.

            "add an extra "subscribed_flag" column ("char 1" and "NULL" for accepting Y/N checkbox values) to the user table and then set this column to 'N' on the "unsubscribe" page. "

            What is "char 1"? Should I use 'ENUM' instead of 'Char'?

            How do I set this column to 'N' on the "unsubscribe" page? Is this something I need to do in Dreamweaver please? If it is not too troubling do you have time to give me a bit more details on how to create the unsubscribe page in DW using your suggested method? i.e. which feature to use and what elements need to be created.

            Sorry I am still a beginner in these areas.

            Thanks very much,
            • 3. Re: urgent: 'del a record wizard' not working
              Günter Schenk Level 4
              Hi Tom,

              >>
              What is "char 1"? Should I use 'ENUM' instead of 'Char'?
              >>

              no, please define this column as "char" (in e.g. PhpMyAdmin) and give it a value of "1", plus make it "NULL" instead of "NOT NULL", as the records must be allowed to have even empty content -- they will be filled with Y/N values later on on your "subscribe" respectively "unsubscribe" pages.

              Using ENUM would in theory work as well - but ADDT doesn´t support this column type well, so make it "char"

              >>
              How do I set this column to 'N' on the "unsubscribe" page? Is this something I need to do in Dreamweaver please?
              >>

              1. create that page and apply ADDT´s "Update Record Wizard" to it

              2. condition: where the user_table´s ID equals the session variable "kt_login_id"

              3. update the user_table and set the new "subscribed_flag" column to :: entered value = N

              That should do it :-)

              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: urgent: 'del a record wizard' not working
                Level 1
                Hi Günter, <br />I have not got the unsubscribe page working yet.My table in MySQL is called 'email' <br /> <br />The error says "Error: <br />Internal error. <br />Developer Details: <br />tNG_update.prepareSQL: <br />No Primary Key Column was set. (UPD_NO_PK_SET)" <br /> <br />"2. condition: where the user_table´s ID equals the session variable "kt_login_id"" <br /> <br />I don't have a login page, is it still "kt_login_id" or should it be something else? <br /> <br />"3. update the user_table and set the new "subscribed_flag" column to :: entered value = N" <br /> <br />Does this step requires me to change the code in code view of DW? <br />I am not sure how to set the column to "::". What is it? and where do I enter the value "=N" please? <br /> <br />The code is <br /> <br /> <?php<br /> echo $tNGs->getErrorMsg();<br />?> <br /> <form method="post" id="form1" action="%3C?php%20echo%20KT_escapeAttribute(KT_getFullUri());%20?%3E"> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <tr> <td class="KT_th"> <label for="email">Email Address to Be Unsubscribed</label> </td> <td> <input type="text" name="email" id="email" value="<?php echo KT_escapeAttribute($row_rsemail['email']); ?>" size="32" /> <br /> <?php echo $tNGs->displayFieldHint("email");?> <?php echo $tNGs->displayFieldError("email", "email"); ?></td> </tr> <tr> <td class="KT_th"> <label for="special_offers_flag">Special offers:</label> </td> <td> <input <?php if (!(strcmp(KT_escapeAttribute($row_rsemail['special_offers_flag']),"Y"))) {echo "checked";} ?> type="checkbox" name="special_offers_flag" id="special_offers_flag" value="Y" /> <br /> <?php echo $tNGs->displayFieldError("email", "special_offers_flag"); ?></td> </tr> <tr> <td class="KT_th"> <label for="newsletters_flag">Newsletters:</label> </td> <td> <input <?php if (!(strcmp(KT_escapeAttribute($row_rsemail['newsletters_flag']),"Y"))) {echo "checked";} ?> type="checkbox" name="newsletters_flag" id="newsletters_flag" value="Y" /> <br /> <?php echo $tNGs->displayFieldError("email", "newsletters_flag"); ?></td> </tr> <tr> <td class="KT_th"> <label for="promotional_materials_flag">Promotional Materials:</label> </td> <td> <input <?php if (!(strcmp(KT_escapeAttribute($row_rsemail['promotional_materials_flag']),"Y"))) {echo "checked";} ?> type="checkbox" name="promotional_materials_flag" id="promotional_materials_flag" value="Y" /> <br /> <?php echo $tNGs->displayFieldError("email", "promotional_materials_flag"); ?></td> </tr> <tr> <td class="KT_th"> <label for="subscribed_flag">Unsubscribe from choosen type of email(s):</label> </td> <td> <input <?php if (!(strcmp(KT_escapeAttribute($row_rsemail['subscribed_flag']),"Y"))) {echo "checked";} ?> type="checkbox" name="subscribed_flag" id="subscribed_flag" value="Y" /> <br /> <?php echo $tNGs->displayFieldError("email", "subscribed_flag"); ?></td> </tr> <tr class="KT_buttons"> <td colspan="2"> <input type="submit" name="KT_Update1" id="KT_Update1" value="Submit" /> <br /></td> </tr> </table> <br /> <br />Thank you, <br />Tom</form>
                • 5. Re: urgent: 'del a record wizard' not working
                  Günter Schenk Level 4
                  Hi Tom,

                  ok, I think I understand that your scenario is independant from ADDT´s login procedure, and that you probably want to establish a sort of mailing list application where users may subscribe/unsubscribe at any time, right ?

                  You´re right, there will be no "kt_login_id" variable available then, and in this case you´d simply have the user enter their email address in order to unsubscribe.

                  However there´s one thing you need to be aware of :: don´t try using ADDT´s "Send Email" feature in this context, as this one hasn´t been designed to send "mass mailing" in a reliable way -- and maybe you should consider using a 3rd party mailing list application right from the start IMHO

                  Cheers,
                  Günter Schenk,
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: urgent: 'del a record wizard' not working
                    Level 1
                    Hi Günter,
                    I am doing my Uni Project for this small company. They have not got a huge budget for email marketing. I am not trying to create a mailing application. I still intend to send out email using MS Outlook. The two pages are just helping me to collect email address and comply with the law.

                    So I cannot get a unsubscribe page that simply have the users enter their email address? If not how can this be done please?

                    I want my manager to shut up and start to use some automate process. He don't have a slightest idea how time consuming and resource wasting of his manually subscribe and unsubscribe process will be in MS Access.

                    Thank you,
                    Tom
                    • 7. Re: urgent: 'del a record wizard' not working
                      Günter Schenk Level 4
                      Hi Tom,

                      >>
                      So I cannot get a unsubscribe page that simply have the users enter their email address?
                      >>

                      sure this will be possible -- but please tell me what comes first, means what data is getting entered in your "email" table, when they´re subscribing ? If possible, please provide a so-called "SQL dump" of this table so I´ll be able to see the table´s "structure"

                      BTW, the error message "No Primary Key Column was set. (UPD_NO_PK_SET)" you posted does indicate one thing :: your "email" table does not have, well, a primary key column set -- you will have to add this mandatory type of column to your table:

                      email_id int(3) unsigned NOT NULL auto_increment

                      to make it all work anyway.

                      Cheers,
                      Günter Schenk,
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: urgent: 'del a record wizard' not working
                        Level 1
                        Hi Günter,

                        please find the table structure as follows, I tried SQL dump, but cannot get it to work. So had to type it out like this. Sorry it looks a bit messy.

                        Field Type Collation Attributes Null Default Extra

                        email_id int(5) UNSIGNED No auto_increment
                        first_name varchar(100) utf8_unicode_ci Yes NULL
                        last_name varchar(100) utf8_unicode_ci Yes NULL
                        org varchar(300) utf8_unicode_ci Yes NULL
                        email varchar(200) utf8_unicode_ci Yes NULL
                        subscribed_flag char(1) utf8_unicode_ci Yes NULL
                        html_flag char(1) utf8_unicode_ci Yes NULL
                        special_offers_flag char(1) utf8_unicode_ci Yes NULL
                        newsletters_flag char(1) utf8_unicode_ci Yes NULL
                        promotional_materials_flag char(1) utf8_unicode_ci Yes NULL

                        Primary Key: email_id

                        Thanks,
                        Tom