hi, i'm new in programming PHP. I have this task to be done.
the first page which is category.php show the list of category that I retrieve from the database name 'event' with table 'category'
here is the code:
//the connect_db already done in single php file
<table border=1 bgcolor="blue">
<tr>
<th>Competition Name</th>
</tr>
<?php
$sql = "SELECT cat_id , cat_name FROM `category`";
$result = mysql_query($sql);
while ($r=mysql_fetch_array($result)){
?>
<tr>
<td>
<a href="testing_cat.php?id=<?php echo $r['cat_id']?>"><?php echo $r['cat_name'] ?></a>
</td>
</tr>
<?php } ?>
</table>
this script has run well which show me the link of localhost/webtest/testing_cat.php?id=CA001 when I click the first category.
My question is how to get the result showing the list of competition that only have the same cat_id as in hyperlink?
thanks