I am a real beginner at PHP so please allow for my lack of knowledge.

I have a website that I have written for a local club. Their membership records (150 members) are a real mess. What they want is a membership database on line that only the committee can see and only the membership secretary update. Rather than me taking several months to hone my skills I am sure there must be something like this readily available to save me re-inventing the wheel.

I have done the usual Google and Hot Scripts searches but these all seem to be self registration systems for website users rather than a club membership database. Does anyone know of any scripts that will do this.

TIA

Colin

    Hey, Post in bullet point stye exactly what you require your script to do 😃

      benracer wrote:

      Hey, Post in bullet point stye exactly what you require your script to do 😃

      1: Usual membership fields name, address, membership no, phone, mobile, email, dues paid, date joined.
      2: table display for non membership secretary and ability to print list by paid, unpaid or surname
      3: membership secretary to create new members, delete old members, change details and to print as above
      4: secure login for all

      I would probably put this in a sub-domain to keep it completely separate from the main site

      I think that that's about it as I said pretty simple.

      Thanks for asking

        colinsp wrote:

        1: Usual membership fields name, address, membership no, phone, mobile, email, dues paid, date joined.

        To insert data have a look at this... http://www.tizag.com/mysqlTutorial/mysqlinsert.php

        colinsp wrote:

        2: table display for non membership secretary and ability to print list by paid, unpaid or surname

        To select and print data look at...
        http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php

        colinsp wrote:

        3: membership secretary to create new members, delete old members, change details and to print as above

        http://www.tizag.com/mysqlTutorial/mysqlupdate.php

        colinsp wrote:

        4: secure login for all

        http://www.phpeasystep.com/workshopview.php?id=6

        When you have some code together do not hesitate to post here for any queries or problems you encounter 😃

          Thanks very much I will check those out.

            Thanks for the suggestions. Looking at those tutorials and a couple of others I now have a table of data displaying fine. I want the user to be able to select order by surname or membership. I am sure I must be able to pass this from a button or link on the html form to the php. I have the order by working fine from a variable what I am having trouble with is passing from the html form the selection order.

            This is my current code (not very tidy and I am sure it could be better written but it works):

            <?php
            
            $username="root";
            $password="";
            $database="membership";
            mysql_connect(localhost,$username,$password);
            @mysql_select_db($database) or die ("Unable to select database");
            
            $order="surname";
            
            $query="SELECT * FROM names order by $order";
            $result=mysql_query($query);
            echo "<table border=1>\n";
            echo "<tr><b><td>Mem.No</td><td>Name</td><td>Surname</td><td>Address</td><td></td><td>Town</td><td>Post Code</td><td>Phone</td><td>Mobile</td><td>email</td><td>Joined</td></b></tr>\n";
            while ($myrow = mysql_fetch_row($result)) {
            printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6], $myrow[7], $myrow[8], $myrow[9], $myrow[10], $myrow[11]  );
            }
            echo "</table>\n";
            
            
            
            ?>

            Does anyone have any thoughts on how I can pass the selection to $order?

            TIA

              "order by surname or membership"
              What do you want it to show? Give an examle of what is in your table, the search query and what the expected results would be. 🙂

                colinsp wrote:
                <?php
                
                $username="root";
                $password="";
                $database="membership";
                mysql_connect(localhost,$username,$password);
                @mysql_select_db($database) or die ("Unable to select database");
                
                $order="surname";
                
                $query="SELECT * FROM names order by $order";
                $result=mysql_query($query);
                ...
                ...
                ?>

                TIA

                where are you getting $order from? or i should say, what's the source of hte surname? is it in the db? if so, you need to "fetch" it first.

                <?php
                  ...
                  ...
                $get_surname = "SELECT * FROM names";
                $surname_query = msyql_query ($get_surname);
                while ($surname_results = mysql_fetch_array ($surname_query, MYSQL_ASSOC))
                { 
                $order = $surname_results ["surname"];
                //continue your code here for each surname.  
                
                $query="SELECT * FROM names order by $order";
                $result=mysql_query($query);
                ...
                ...  
                
                ?>
                

                hope that helps!!! 🙂

                  Write a Reply...