Thanks for the help - I managed to return results from multiple tables.
I have now come across a new problem.
There is a one to many relationship - One practice example has more than one category. When the results are displayed, all the fields for the practice example is displayed with each category. I want to display the practice example details once, then list all the categories for that practice example.
Can anyone help with how to do this.
Here is my php so far:
<?php
mysql_connect ("localhost", "root", "purple1");
mysql_select_db ('good_practice');
$region=$POST["region"];
$search=$POST["search"];
$result = mysql_query("SELECT * FROM practice AS p, gpcats AS g, def_gpcats AS d WHERE p.gpid = g.gpid
AND g.gpcatid = d.gpcatid");
if(mysql_num_rows($result)>0)
while($r=mysql_fetch_array($result))
{
$id=$r["id"];
$min_age=$r["min_age"];
$max_age=$r["max_age"];
$gptext=$r["gptext"];
$verified=$r["verified"];
$gpcatdesc=$r["gpcatdesc"];
echo "<b>Project ID:</B>$id<br><b>Age Range:</b> $min_age to $max_age<br> <b>Good Practice Example:</b>
<br>$gptext<br> <b>Updated:</b> $verified<br><b>Categories</b>$gpcatdesc<hr><br>";
}
else {echo "Sorry, no results found ";
}
?>