Form changed to contect to database?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rob (SA)
    Lieutenant Colonel

    • Nov 2006
    • 586

    #31
    Re: Form changed to contect to database?

    Hi Watdaflip,

    Thanks for your offer to help.

    I have tried various variations of the email you sugested. it returns with a system error and the mail could not be delivered.

    Please check my website http://www.gnjgf.co.za/ out and send and email through the feedback section and I will be sure to get your email.
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com

    Comment

    • Watdaflip
      Major General

      • Sep 2005
      • 2116

      #32
      Re: Form changed to contect to database?

      Alright I contacted you via your feedback form.

      Register/Login Script
      Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

      Comment

      • Rob (SA)
        Lieutenant Colonel

        • Nov 2006
        • 586

        #33
        Re: Form changed to contect to database?

        Hi There,

        Havent received anything as yet.

        Maybe the server is slow.
        Kind Regards
        Rob
        www.gnjgf.co.za
        www.oryan-projects.com

        Comment

        • Watdaflip
          Major General

          • Sep 2005
          • 2116

          #34
          Re: Form changed to contect to database?

          Hmm, try contacting me through mine.

          Register/Login Script
          Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

          Comment

          • Rob (SA)
            Lieutenant Colonel

            • Nov 2006
            • 586

            #35
            Re: Form changed to contect to database?

            Hi Folks,

            I have managed to get my page www.gnjgf.co.za/GolfMembers.html to look ok yet need to find out if this information below is correct will populate the page ?


            <!--------------------------------------------------------------------->
            <! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
            <!--------------------------------------------------------------------->

            <table border=3 width="35%" cellspacing=0 style="background-color:#FFFFFF;">

            <!--------------------------------------------------------------------->
            <!MAKE CHANGES TO THIS SECTION IF YOU WANT THE PAGE HEADING/s TO CHANGE>
            <!--------------------------------------------------------------------->

            <caption>
            <font style>&nbsp</font>
            </caption>
            <caption>
            <b><font style="font-size:20px" color="#00008B" face="Arial">
            GAUTENG NORTH JUNIOR GOLF FOUNDATION</font><b>
            </caption>
            <caption>
            <font style="font-size:16px" color="#00008B" face="Arial">
            MEMBERSHIP LIST</font>
            </caption>
            <caption>
            <font style>&nbsp</font>
            </caption>

            <!--------------------------------------------------------------------->
            <! CHANGE COLUMN HEADING/s OF THE TABLE HERE >
            <!--------------------------------------------------------------------->

            <tr>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">SURNAME</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">NAME</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">DATE OF BIRTH</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">IDENTITY NO.</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">CELL PHONE</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">HOME PHONE</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">WORK PHONE</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">&nbsp &nbsp FAX &nbsp &nbsp</font></b></td></th>
            <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">E-MAIL</font></b></td></th>
            </tr>

            <!--------------------------------------------------------------------->
            <! THIS SECTION IS WHAT CALLS IT FROM THE DATABASE TABLE >
            <!--------------------------------------------------------------------->

            <?
            $MySQLhost="local****";
            $MySQLusername="******h";
            $MySQLpassword="f********n";
            $MySQLdatabase="egh***_members";
            $dbconnect = mysql_connect($MySQLhost,$MySQLusername,$MySQLpass word)
            or die ("Could not connect to mysql because ".mysql_error());
            mysql_select_db($MySQLdatabase)
            or die ("Could not select database because ".mysql_error());

            $Surname=.$_POST['Surname'].;
            $Name=.$_POST['Name'].;
            $Date of Birth=.$_POST['Date_of_Birth'].;
            $Identity Number=.$_POST['Identity_No'].;
            $Cell_Phone=.$_POST['Cell_Phone'].;
            $Home_Phone=.$_POST['Home_phone'].;
            $Work Phone=.$_POST['Work_phone'].;
            $Fax=.$_POST['Fax'].;
            $Email=.$_POST['Email'];
            $query = mysql_query("INSERT INTO MEMBERS (Surname, Name, Date_of_Birth, Identity_No, Cell_Phone, Home_phone, Work_phone, Fax, email)
            VALUES
            ('$Surname','$Name','$Date_of_Birth','$Identity_No ','$Cell_Phone', '$Home_phone','$Work_phone','$Fax','$email')", $dbconnect);
            exit;
            }
            ?>



            Kind Regards
            Rob
            www.gnjgf.co.za
            www.oryan-projects.com

            Comment

            • Watdaflip
              Major General

              • Sep 2005
              • 2116

              #36
              Re: Form changed to contect to database?

              Hey Rob,

              No it's not going to give the desired results. The table needs tweaking and it still has the insert query (it will just keep adding blank records to the database, not display them).

              Try this
              PHP Code:
              <!--------------------------------------------------------------------->
              <!MAKE CHANGES TO THIS SECTION IF YOU WANT THE PAGE HEADING/s TO CHANGE>
              <!--------------------------------------------------------------------->
               
              <caption>
              <font style>&nbsp</font>
              </caption>
              <caption>
              <b><font style="font-size:20px" color="#00008B" face="Arial">
              GAUTENG NORTH JUNIOR GOLF FOUNDATION</font><b>
              </caption>
              <caption>
              <font style="font-size:16px" color="#00008B" face="Arial">
              MEMBERSHIP LIST</font>
              </caption>
              <caption>
              <font style>&nbsp</font>
              </caption>

              <!--------------------------------------------------------------------->
              <! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
              <!--------------------------------------------------------------------->
               
              <table border=3 width="35%" cellspacing=0 style="background-color:#FFFFFF;">
               
              <!--------------------------------------------------------------------->
              <!         CHANGE COLUMN HEADING/s OF THE TABLE HERE         >
              <!--------------------------------------------------------------------->
               
              <tr>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">SURNAME</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">NAME</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">DATE OF BIRTH</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">IDENTITY NO.</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">CELL PHONE</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">HOME PHONE</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">WORK PHONE</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">&nbsp &nbsp FAX &nbsp &nbsp</font></b></th>
              <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">E-MAIL</font></b></th>
              </tr>
               
              <!--------------------------------------------------------------------->
              <! THIS SECTION IS WHAT CALLS IT FROM THE DATABASE TABLE >
              <!--------------------------------------------------------------------->
               
              <?
              $MySQLhost="local****"; 
              $MySQLusername="******h"; 
              $MySQLpassword="f********n"; 
              $MySQLdatabase="egh***_members"; 
              $dbconnect = mysql_connect($MySQLhost,$MySQLusername,$MySQLpass  word) 
              or die ("Could not connect to mysql because ".mysql_error()); 
              mysql_select_db($MySQLdatabase) 
              or die ("Could not select database because ".mysql_error());
               
              $select = mysql_query("SELECT Surname, Name, Date_of_Birth, Identity_No, Cell_Phone, Home_phone, Work_phone, Fax, email FROM MEMBERS", $dbconnect);
               while($row = mysql_fetch_assoc($select))
              {

              echo '
              <tr>
              <td>'.$row['Surname'].'</td>
              <td>'.$row['Name'].'</td>
              <td>'.$row['Date_of_Birth'].'</td>
              <td>'.$row['Identity_No'].'</td>
              <td>'.$row['Cell_Phone'].'</td>
              <td>'.$row['Home_phone'].'</td>
              <td>'.$row['Work_phone'].'</td>
              <td>'.$row['Fax'].'</td>
              <td>'.$row['email'].'</td>
              </tr>';
              }
              ?>
              </table>

              Register/Login Script
              Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

              Comment

              • Rob (SA)
                Lieutenant Colonel

                • Nov 2006
                • 586

                #37
                Re: Form changed to contect to database?

                Hi Folks,

                I have eventually managed to get the page to populate and this can be seen at www.gnjgf.co.za/entryformmysql.php

                The screen fills up great but I now have some other challenges I have to overcome.
                1. How do I prevent duplication of entries on my form at www.gnjgf.co.za/entryform.php?
                2. How do I get the text to appear in smaller text than the column headings and not not show exactly whats in the table?
                This would be starters to get a better look and feel and any comments here would be most welcome
                Kind Regards
                Rob
                www.gnjgf.co.za
                www.oryan-projects.com

                Comment

                Working...
                X