Hi
I knew there was nothing wrong with the query so I tried a different approach and BINGO it works
Here is the code
PHP Code:
<html>
<body>
<?php
$username=" ";
$password=" ";
$database=" ";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
echo "Connected to Honours Board Database....... results for winner named ";
echo $_POST['name1'];
$name1 = $_POST['name1'];
$query="SELECT field_id_8, field_id_7, field_id_6 FROM exp_channel_data WHERE field_id_8 LIKE '%$name1%' ORDER BY field_id_7 ASC, field_id_6 DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table width="690" border="0", cellpadding="0" cellspacing="0" background="/members/Pictures/ceder.jpg" >
<tr>
<th><div align="left"><font face="Arial, Helvetica, sans-serif">Year</font></div></th>
<th><div align="left"><font face="Arial, Helvetica, sans-serif">Competition</font></div></th>
<th><div align="left"><font face="Arial, Helvetica, sans-serif">Winner</font></div></th>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"field_id_6");
$f2=mysql_result($result,$i,"field_id_7");
$f3=mysql_result($result,$i,"field_id_8");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
</tr>
<?php
$i++;
}
?>
</body>
</html>
Thanks for the help
Bookmarks