Re: Form changed to contect to database?
Hi Watdaflip,
Thanks again for your support. It is most appreciated.
Herewith the details requested.
<?php
$MySQLhost="localhost";
$MySQLusername="r0berth";
$MySQLpassword="f0undat10n";
$MySQLdatabase="eghfya_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 * FROM MEMBERS", $dbconnect);
echo '
<table>
<tr>
<td>Gender</td>
<td>Name</td>
<td>Surname</td>
<td>Country</td>
<td>Date_of_Birth</td>
<td>Identity_No</td>
<td>P_O_Box</td>
<td>Suburb</td>
<td>Postal_Code</td>
<td>Relationship</td>
<td>Language</td>
<td>Gaurdians_Name</td>
<td>Gaurdians_Surname</td>
<td>Cell_Phone</td>
<td>Home_phone</td>
<td>Work_phone</td>
<td>Fax</td>
<td>email</td>
<td>Division</td>
<td>Home_Club</td>
<td>Handicap</td>
<td>School</td>
<td>Grade</td>
<td>Type</td>
<td>Membership</td>
<td>Rules</td>
</tr>';
while($row = mysql_fetch_assoc($select))
{
echo '
<tr>
<td>'.$row['Gender'].'</td>
<td>'.$row['Name'].'</td>
<td>'.$row['Surname'].'</td>
<td>'.$row['Country'].'</td>
<td>'.$row['Date_of_Birth'].'</td>
<td>'.$row['Identity_No'].'</td>
<td>'.$row['P_O_Box'].'</td>
<td>'.$row['Suburb'].'</td>
<td>'.$row['Postal_Code'].'</td>
<td>'.$row['Relationship'].'</td>
<td>'.$row['Language'].'</td>
<td>'.$row['Gaurdians_Name'].'</td>
<td>'.$row['Gaurdians_Surname'].'</td>
<td>'.$row['Cell_Phone'].'</td>
<td>'.$row['Home_phone'].'</td>
<td>'.$row['Work_phone'].'</td>
<td>'.$row['Fax'].'</td>
<td>'.$row['email'].'</td>
<td>'.$row['Division'].'</td>
<td>'.$row['Home_Club'].'</td>
<td>'.$row['Handicap'].'</td>
<td>'.$row['School'].'</td>
<td>'.$row['Grade'].'</td>
<td>'.$row['Type'].'</td>
<td>'.$row['Membership'].'</td>
<td>'.$row['Rules'].'</td>
</tr>';
}
echo '</table>';
$Gender=$_GET['Gender:'];
$Name=$_GET['Name'];
$Surname=$_GET['Surname:'];
$Country=$_GET['Country:'];
$Date_of_Birth=$_GET['Date_of_Birth:'];
$Identity_No=$_GET['Identity_No'];
$P_O_Box=$_GET['P_O_Box'];
$Postal_Code=$_GET['Postal_Code'];
$Suburb=$_GET['Suburb'];
$Relationship=$_GET['Relationship'];
$Language=$_GET['Language'];
$Gaurdians_Name=$_GET['Gaurdians_Name'];
$Gaurdians_Surname=$_GET['Gaurdians_Surname'];
$Cell_Phone=$_GET['Cell_Phone'];
$Home_phone=$_GET['Home_phone'];
$Work_phone=$_GET['Work_phone'];
$Fax=$_GET['Fax'];
$email=$_GET['email'];
$Division=$_GET['Division'];
$Home_Club=$_GET['Home_Club'];
$School=$_GET['School'];
$Grade=$_GET['Grade'];
$Type=$_GET['Type'];
$Membership=$_GET['Membership'];
$Rules=$_GET['Rules'];
$Rules=$_GET['Handicap'];
$query = mysql_query("INSERT INTO MEMBERS VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date_of_Birth', '$Identity_No', '$P_O_Box', '$Postal_Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians_Name', '$Gaurdians_Surname', '$Cell_Phone', '$Home_phone', '$Work_phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Home_Club', '$Fax', '$Rules')", $dbconnect);
echo "Form submitted";
?>
Hi Watdaflip,
Thanks again for your support. It is most appreciated.
Herewith the details requested.
<?php
$MySQLhost="localhost";
$MySQLusername="r0berth";
$MySQLpassword="f0undat10n";
$MySQLdatabase="eghfya_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 * FROM MEMBERS", $dbconnect);
echo '
<table>
<tr>
<td>Gender</td>
<td>Name</td>
<td>Surname</td>
<td>Country</td>
<td>Date_of_Birth</td>
<td>Identity_No</td>
<td>P_O_Box</td>
<td>Suburb</td>
<td>Postal_Code</td>
<td>Relationship</td>
<td>Language</td>
<td>Gaurdians_Name</td>
<td>Gaurdians_Surname</td>
<td>Cell_Phone</td>
<td>Home_phone</td>
<td>Work_phone</td>
<td>Fax</td>
<td>email</td>
<td>Division</td>
<td>Home_Club</td>
<td>Handicap</td>
<td>School</td>
<td>Grade</td>
<td>Type</td>
<td>Membership</td>
<td>Rules</td>
</tr>';
while($row = mysql_fetch_assoc($select))
{
echo '
<tr>
<td>'.$row['Gender'].'</td>
<td>'.$row['Name'].'</td>
<td>'.$row['Surname'].'</td>
<td>'.$row['Country'].'</td>
<td>'.$row['Date_of_Birth'].'</td>
<td>'.$row['Identity_No'].'</td>
<td>'.$row['P_O_Box'].'</td>
<td>'.$row['Suburb'].'</td>
<td>'.$row['Postal_Code'].'</td>
<td>'.$row['Relationship'].'</td>
<td>'.$row['Language'].'</td>
<td>'.$row['Gaurdians_Name'].'</td>
<td>'.$row['Gaurdians_Surname'].'</td>
<td>'.$row['Cell_Phone'].'</td>
<td>'.$row['Home_phone'].'</td>
<td>'.$row['Work_phone'].'</td>
<td>'.$row['Fax'].'</td>
<td>'.$row['email'].'</td>
<td>'.$row['Division'].'</td>
<td>'.$row['Home_Club'].'</td>
<td>'.$row['Handicap'].'</td>
<td>'.$row['School'].'</td>
<td>'.$row['Grade'].'</td>
<td>'.$row['Type'].'</td>
<td>'.$row['Membership'].'</td>
<td>'.$row['Rules'].'</td>
</tr>';
}
echo '</table>';
$Gender=$_GET['Gender:'];
$Name=$_GET['Name'];
$Surname=$_GET['Surname:'];
$Country=$_GET['Country:'];
$Date_of_Birth=$_GET['Date_of_Birth:'];
$Identity_No=$_GET['Identity_No'];
$P_O_Box=$_GET['P_O_Box'];
$Postal_Code=$_GET['Postal_Code'];
$Suburb=$_GET['Suburb'];
$Relationship=$_GET['Relationship'];
$Language=$_GET['Language'];
$Gaurdians_Name=$_GET['Gaurdians_Name'];
$Gaurdians_Surname=$_GET['Gaurdians_Surname'];
$Cell_Phone=$_GET['Cell_Phone'];
$Home_phone=$_GET['Home_phone'];
$Work_phone=$_GET['Work_phone'];
$Fax=$_GET['Fax'];
$email=$_GET['email'];
$Division=$_GET['Division'];
$Home_Club=$_GET['Home_Club'];
$School=$_GET['School'];
$Grade=$_GET['Grade'];
$Type=$_GET['Type'];
$Membership=$_GET['Membership'];
$Rules=$_GET['Rules'];
$Rules=$_GET['Handicap'];
$query = mysql_query("INSERT INTO MEMBERS VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date_of_Birth', '$Identity_No', '$P_O_Box', '$Postal_Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians_Name', '$Gaurdians_Surname', '$Cell_Phone', '$Home_phone', '$Work_phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Home_Club', '$Fax', '$Rules')", $dbconnect);
echo "Form submitted";
?>
Comment