Hi John,
Thanks for the reply.
Your are correct in noticing that I make reference to another file.
I am trying to vreate a tournament entry form that will limit the field isze to 80. The information is doen via MySQL and ideally the excercise would be that if the emtries are equal to or greater tha 80 the player will not be able to enter.
If one veiws the file then the information that is produced in the left hand column will determine my result.
So yes you are correct the two need to be linked.
PHP Code:
<?php
$connect = mysql_connect("localhost", "e****a_r***t", "r****h") or
die ("Hey loser, check your server connection.");
mysql_select_db("eghfya_Members");
$quey1="select * from _Form_Nr_3 ORDER BY `i_wish_to_play` ASC, `surname` ASC ";
$result=mysql_query($quey1) or die(mysql_error());
?>
<!------------------------------------------------------------------>
<! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
<!------------------------------------------------------------------>
<table border=1 width="85%" bordercolor="#D3E2FE" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" style="font-size:11px" cellspacing=0>
<!------------------------------------------------------------------>
<! THIS SECTION CHANGES THE MAIN HEADING >
<!------------------------------------------------------------------>
<caption><b><font style="font-size:20px" color="#376091" face="Arial">
</font><b><caption>
<!------------------------------------------------------------------->
<! THIS SECTION FETCHES THE INFORMATION FROM THE MYSQL TABLE >
<!------------------------------------------------------------------->
<?php
$counter = array();
$last_wish_to_play = "";
$firstNAsAString = "";
while($row=mysql_fetch_array($result)){
//----------------------------------------------------------------------------------------------------
// THIS SECTION ADDS 3 EMPTY LINES IF THERE IS A SPLIT BUT ONLY AFTER SOME RECORDS HAVE BEEN DISPLAYED
//----------------------------------------------------------------------------------------------------
if($i > 0 AND $row['i_wish_to_play'] != $last_wish_to_play)
{
echo '<tr>
<td colspan="3"> </td>
</tr>';
}
//------------------------------------------------------
// THIS SECTION ADDS HEADINGS
//------------------------------------------------------
if ($row['i_wish_to_play'] != $last_wish_to_play) {
echo '<tr>
<td colspan="3" align="center" bgcolor="#376091"><font style="font-size:11px" color="#FFFFFF" face="Arial"><b>'.$row['i_wish_to_play'].'</b></font></td>
</tr>';
echo '<tr>
<td bgcolor="#376091"><font style="font-size:11px" color="#FFFFFF" face="Arial"><b>FULL NAME</b></font></td>
<td align="center" bgcolor="#376091"><font style="font-size:11px" color="#FFFFFF" face="Arial"><b>HANDICAP</b></font></td>
<td align="center" bgcolor="#376091"><font style="font-size:11px" color="#FFFFFF" face="Arial"><b>CELL NUMBER</b></font></td>
</tr>';
}
echo '<tr><td bgcolor="#B5CCE4"><font style="font-size:10px" color="#000000" face="Arial">';
echo '<option value="'.strtoupper($row['surname']).', '.strtoupper($row['name']).'">'.strtoupper($row['surname']).', '.strtoupper($row['name']).'</option>';
echo '</td><td align="center" bgcolor="#B5CCE4"><font style="font-size:10px" color="#000000" face="Arial">';
echo $row['my_handicap_is'];
echo '</td><td align="center" bgcolor="#B5CCE4"><font style="font-size:10px" color="#000000" face="Arial">';
echo $row['cell_phone'];
if($row['i_wish_to_play'] != $last_wish_to_play)
{
// the first n words to extract
$n = 5;
// extract the words
$words = explode(" ", $row['i_wish_to_play']);
// chop the words array down to the first n elements
$firstN = array_slice($words, 1, $n-1);
// glue the 3 elements back into a spaced sentence
$firstNAsAString = implode(" ", $firstN);
}
if(!isset($counter[$firstNAsAString]))
$counter[$firstNAsAString] = 0;
else
$counter[$firstNAsAString]++;
$last_wish_to_play = $row['i_wish_to_play'];
$i++;
echo '</td></tr>';
}
echo '</table>';
?>
The othe rpart which shows the left hand side of the page is this part:
PHP Code:
<!------------------------------------------------------------------>
<! THIS SECTION CHANGES THE MAIN HEADING >
<!------------------------------------------------------------------>
<table>
<td colspan="2" width="25%" align="center" bgcolor="#376091"><font style="font-size:12px" color="#FFFFFF" face="Arial"><b>TOTAL ENTRIES</b></font></td>
</table>
<!-------------------------------------------------------------------->
<! THIS SECTION COUNTS THE ROWS THAT ARE UNIQUE AND PROVIDES RESULT >
<!-------------------------------------------------------------------->
<?php
echo '<table border=1 bgcolor=#B5CCE4 bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" cellspacing=0>';
foreach($counter as $key => $value)
{
echo '<tr>
<td align="center" width="10%" bgcolor="#B5CCE4"><font style="font-size:12px" color="#000000" face="Arial"><b>'.$value.'</b></font></td>
<td colspan="2" width="65%" align="center" bgcolor="#B5CCE4"><font style="font-size:10px" color="#000000" face="Arial">'.$key.'</font></td>
</tr>';
}
echo '</table>';
?>
I currently use a program called BlueVoda which is freely downloadable form the internet - WYSIWYG web builder
I would be so appreciatetive if you could help me there as it is where I would be going to.
Regards
Rob
Bookmarks