9 Replies Latest reply on Mar 3, 2008 4:57 AM by Günter Schenk

    Filter by registration or upload date?

    mrcharis2003@yahoo.c
      Hi
      I am trying to set up a table that can be filtered by registration ( or file upload date) date so as to show the most recent users or file uploads ( pics ) at the top of the table ......

      I have been following the " create an image gallery using ADDT ' and I can get the file upload date working ok and filter a table using the date and all work ok .... just the way it should in the tutorial.... but.....

      So...... I want to do basically the same thing but using the registratition wizard instead of the record insert wizard.... because.... I want to be able to collect all the new users information at the same time as they register and upload a pic as well.....
      Does that make sense?

      So anyway ....... I can create a simple table in phpmyadmin with all the usual fields to collect user details and a date field to store regisrration date and set it to datetime not nul 0000-00-00 00:00:00 just as in the tutorial so......... I create a new php page register.php and follow the steps as in the " create an image gallery using ADDT " ( but with the register wizard) tutorial so...... I set the date field on the form to text field and imput text and use the {NOW_DT} as default and then finish and create the form....and all works well.....I can preview and it has the correct date but I don't want the date of registration to show up on the form so I go back and remove the date field from the form ( not in the wizard) and try to preview again and when I fill out the form and submit I get the SQL error colum datereg_usr cannot be null
      Hm......... So why does it work with the update form wizard and not the registration wizard? I can't figure it out

      Am I going about this the right way?

      Do I need to keep the registration form and information separate from the user information & details? Is this why there are special login tables as in Mr Gunter's login table tutorial?

      Is it posible do do it all from the same form? Is it also possible to store and disploay the lassed updated and logged in dates?

      I read about setting up the addt registration tables on Mr. Gunter's site and I can do that ok but I don't understand why I need to use the addt login table? can anyone explain ?

      I eventually would like to also be able to filter by using the last logged on user or last update ( so similar to many other forums etc....)

      It's all getting a bit much for me ... but I am trying to get it together

      ANy help would be much appreciated
      Have a nice day
        • 1. Re: Filter by registration or upload date?
          Günter Schenk Level 4
          Hi Charis,

          let´s first clear up a fundamental misunderstanding first:

          -------
          Is this why there are special login tables as in Mr Gunter's login table tutorial?
          -------

          the login tables mentioned in my tutorial are not "special", and you definitely don´t need them if you already managed to set up your own ones -- they have been provided for new ADDT users which might be struggling with setting them up manually, that´s all

          -------
          Do I need to keep the registration form and information separate from the user information & details?
          -------

          the registration form does insert into your login table, and the "user information & details" should IMO be part of your login table, and you can certainly add addtional columns to that table.

          When it comes to storing any *unrelated* information like e.g. which user uploads whatever image, I recommend storing the "kt_login_id" session variable in an additional column of your "images" table.

          -----
          Is it also possible to store and disploay the lassed updated and logged in dates?
          -----

          The "logged_in" dates are stored in what my tutorial provides as "login_stats" table -- but what do you mean with "last_updated" ? an image ?

          -------
          I am trying to set up a table that can be filtered by registration ( or file upload date) date so as to show the most recent users or file uploads ( pics ) at the top of the table
          -------

          honestly said, you most assumingly won´t need to add another table for storing & retrieving such statistics -- I´d rather suggest querying the existing...

          a) login table: for the "registration" related information, and...

          b) the image table: for the file/image upload statistics -- and that´s why I´m suggesting to store the "kt_login_id" session variable in an additional column, otherwise you won´t be able to track which user uploaded what

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Filter by registration or upload date?
            mrcharis2003@yahoo.c Level 1
            Cheers
            Thanks for your propt response
            I am sorry I put toooo many questions in the one post
            I will try out your suggestions right away...

            I made a mistake saying that I want to 'filter' tables using registration date I think I mean 'sort' the tables using most recently registered users

            And when I say last_updated I mean that when you go to the master detail page ( or even in the list users page ) it can display the registration date , the date the user last logged on and the date the user last updated their records........ Is that possible?
            (and use these dates to sort, filter or search by)

            I am still can't sus out my problem with not displaying the registration date on the register form ( but still inserting ibut I think I can figure it out

            So thanks very much for all your help
            will keep you posted
            have a nice day
            • 3. Re: Filter by registration or upload date?
              Günter Schenk Level 4
              OK, I think I understand now -- you want to add those filter criteria to ADDT´s Dynamic Lists ?

              If so, I fear you´re out of luck, because any Dynamic List items are by default related to a defined database table (e.g. the "images" table) which is going to be inserted to respectively updated using the associated Dynamic Form -- and your "login" table´s records are outside this scope.

              If you need such advanced statistics, you´d better create a regular "display only" listing with DW

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Filter by registration or upload date?
                mrcharis2003@yahoo.c Level 1
                Hi there
                Thanks for your answers!!
                Wow my head is spinning but I think I am getting it figured out ...slowly

                Firstly..... what I am trying to do is create a site that displays information about different types of businesses cafes, bars, etc I would like to display the information in dynamic lists and sort it by most recently added businesses ( or by most recently updated )
                I would like to have a basic list business page which has a thumb, name and description of the businesses as well as the registration
                (or date added), last updated and last login dates

                I am getting really close to having all this working.... Dreamweaver is really amazing

                So.....

                I could create my 'add new business form' by following the steps as described in the 'create an image gallery usinng addt' tutorial which uses the insert record form wizard , which would allow me to sort the most recently added businesses by date ( and would remove the date field from my form but still insert it into my database).
                But......
                Initially as the administrator ( and only account holder) I will upload all the information myself, logged in using my admin account so I , think I , would have to use use a form created with the insert form wizard to generate a new registration date(or added date) for each new business I add..... so far so good .... I think ....

                But..... As my site grows I would like all the businesses listed on my site to be registered users with their own accounts so that they can update their own information as they please ....

                So ...... I really want to make entering all their information as simple as possible. I would like all this info, and pics to be inserted from one form into one table. I would like the registration and the add new business process ( including uploading pics ) to be done at the same time from the same form..... Am I on the right track?
                Is this all posible?
                Can I use the date generated in the registration process to sort info?
                Can I specify where to store the registration date without enabling account expiration?

                You said that
                "the registration form does insert into your login table, and the "user information & details" should IMO be part of your login table, and you can certainly add additional columns to that table."

                I have been racking my brain even googled it and went to wikipedia and still can't figure out what 'IMO' means so I can't really understand that part of your advise

                What is a "display only" listing?

                You said "and your "login" table´s records are outside this scope"
                Sorry..... but could you give a little more detail? I have been try ing hard but can't really get it.

                Thanks again for all your help

                will try to help solve some othere peoples problems as soon as I know how

                have a great day
                • 5. Re: Filter by registration or upload date?
                  Günter Schenk Level 4
                  Hi Charis,

                  first of all :: thanks for providing such detailed specifications, that makes it easier to follow.

                  -----
                  Wow my head is spinning
                  -----

                  mine too, believe me ;-)

                  ------
                  Firstly..... what I am trying to do is create a site that displays information about different types of businesses cafes, bars, etc I would like to display the information in dynamic lists and sort it by most recently added businesses ( or by most recently updated )
                  ------

                  if this list is supposed to be "available to the public", and if this list is not going to query against your ADDT "login" table, I recommend to create an ADDT Dynamic List, strip his one from all initially created insert/update/delete buttons/links and make the single "edit" links located to the right of each list item point to a simple "display only" page which reveals more info about the associated "business".

                  This list will have all sorts of sorting functionality available right from the start. You could also create a similar list with DW itself, but adding the sorting features will be a little tricky

                  -----
                  I would like to have a basic list business page which has a thumb, name and description of the businesses as well as the registration (or date added), last updated and last login dates
                  -----

                  well, let´s both try to clarify something important :: at least the "last login" info *will* have to be derived from your ADDT "login" table, but all other information (thumbnail, name, description, whatever else) are supposed to be derived from, say, your "business" table, correct ?

                  If you would like to give your site visitors such a basic list, I would by no means even try to include whatever "last login" info (derived from the "login" table) in here, because I don´t think this info has any relevenace to the visitor -- but info such as "date added", "last updated" etc are certainly enough and can be stored in your business table.

                  -------
                  I could create my 'add new business form' by following the steps as described in the 'create an image gallery usinng addt' tutorial which uses the insert record form wizard , which would allow me to sort the most recently added businesses by date ( and would remove the date field from my form but still insert it into my database).
                  But......
                  Initially as the administrator ( and only account holder) I will upload all the information myself, logged in using my admin account so I , think I , would have to use use a form created with the insert form wizard to generate a new registration date(or added date) for each new business I add..... so far so good .... I think ..
                  -------

                  each of the submitted "business" records will - on the long run - have to be allocated to a unique "kt_login_id" value for later enabling the respective record´s owner to update his own stuff only, and that´s why I suggested to add a numeric "owner_id" to your business table which will hold that value.

                  -----
                  But..... As my site grows I would like all the businesses listed on my site to be registered users with their own accounts so that they can update their own information as they please
                  -----

                  If you´re currently the only one who´s going to add all the records, you should consider preparing those user accounts right now and select the "owner" from a menu -- doing this right from the start will definitely ease the subsequent transition towards an "update their own information" approach

                  -----
                  I would like all this info, and pics to be inserted from one form into one table.
                  -----

                  no problem, as long it´s the "business" table

                  -----
                  I would like the registration and the add new business process ( including uploading pics ) to be done at the same time from the same form.
                  -----

                  Please just forget about mixing the "registration" procedure with the "add business" procedure ! These are unrelated steps and would require to insert information in two different tables.

                  ------
                  Can I use the date generated in the registration process to sort info?
                  ------

                  for sorting the business records, you´d better sort on the "date_added" info that stored in the "business" table

                  ------
                  Can I specify where to store the registration date without enabling account expiration?
                  ------

                  the "account expiration" section can be enabled/disabled from within ADDT´s Control Panel, the registration date is alwys getting stored in your "login" table

                  ------
                  can't figure out what 'IMO' means
                  ------

                  'IMO' is a common abbrevation for "in my opinion" -- sort of "geek speak", so to say :-)

                  Guess I need a long break now :-)

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver
                  • 6. Re: Filter by registration or upload date?
                    mrcharis2003@yahoo.c Level 1
                    Hi thanks so much for your suggestions

                    I will take your advise and keep my register and add business processes separate , and use different tables but.......
                    I am still not sure why I have to use two separate tables?
                    But I will keep them separate if you say so.

                    You suggested using dynamic lists....... whoa ..... I don't know much about that seems a rather steep learning curve but I'll give it a try
                    I like the insert and update delete features maybe easier to use for my admin section
                    I have never used dynamic lists before I gave it a few hours and still can't figure it out, followed all supplied info from addt help etc...

                    When ADDT says 'list' is that just the same as DW 'table' ?

                    I figure that the 'dynamic detail list , dynamic master list and dynamic form list' are similar to the master detail page set in dw

                    Are there any tutorials around that explain how to use 'dynamic lists'?

                    I can follow the wizards ok and go to help with anything I don't understand but......

                    To my understanding so far to use dynamic lists I need to create
                    a dynamic form page
                    a dynamic detail list page
                    and a dynamic master page......
                    so far so good ...... but.......
                    how many other pages do I need to create?
                    I not sure where my update records page should be?
                    When I create a form with 'dynamic form' wizard it creates a nice form with update buttons on the form but when I preview they are gone...... Where did they go?

                    anyway I will try to get it all happening.......

                    thanks again for all your help
                    have a great day

                    I writing a beginners tutorial at the moment which explains how to use wamp server and create tables and define new site and connect to database and then create a registration system with addt
                    hope will help take the load off you guys a bit

                    Have a great day
                    thanks again
                    • 7. Re: Filter by registration or upload date?
                      Günter Schenk Level 4
                      Hi charis,

                      -----
                      I am still not sure why I have to use two separate tables?
                      -----

                      This depends on the question whether each "user" might - on the long run - be adding more than just one "business", or if each user will definitely just be adding one business and not more.

                      But as you apparently did already provide an extra table for the "business" data, I suspect each user will be allowed to submite multiple "business" records, correct ? If so, the separation between tables I mentioned is inescapable, trust me :-)

                      Cheers,
                      Günter Schenk
                      Adobe Community Expert, Dreamweaver
                      • 8. Re: Filter by registration or upload date?
                        mrcharis2003@yahoo.c Level 1
                        Ah.......
                        That makes perfect sense.... your always two steps ahead.

                        Hm....... but.....that just opens up more questions for me......

                        Like....... as I will have different levels of members the lowest of which will get a small 'free' listing then higher 'paying' members will receive more detailed listing and the highest level will be able to update their info at will .... but still only one member name and one business....... Now you've got me thinking.... so ..... I might need a higher level again which are for people who want to add more than one business or franchise owners so........ I will figure all the rest out... thanks for getting me thinking ahead

                        thanks again
                        always

                        Have a nice day
                        • 9. Re: Filter by registration or upload date?
                          Günter Schenk Level 4
                          Hi Charis,

                          ----
                          I might need a higher level again which are for people who want to add more than one business or franchise owners so.
                          ----

                          this is correct -- you could either use ADDT´s default "level" system for making this distinction, but you could also (that´s my preferred method...) add additional columns (char 1) to your "login" table, naming them e.g. "multiple_entries_allowed", and adding additional checkbox fields to your own "admin users" account which allow you to activate/deactivate those settings this way.

                          ------
                          thanks for getting me thinking ahead
                          ------

                          I´m happy to have shown you how important it is to "plan ahead" -- when creating any kind of "web application" you´ll note that your initial draft will most likely be changed and extended, and that´s why it´s important to separate the "logistics" right from the start (means, using different tables) in order to avoid having to rewrite your whole application at a later time.

                          Cheers,
                          Günter Schenk
                          Adobe Community Expert, Dreamweaver