Hi,
I'm very new to PHP and have managed to get through most of the problems I've encountered so far, but I have got to one point that I can't seem to solve.
I have two mysql tables (Categories & Products), I have a page that shows the categories (generated from the categories table) and when a category is selected it lists the products in that category.
Due to stock etc. not all categories always have products associated to them.
The Category & Product Tables are automatically updated, so what I need to do is only show categories that have products associated to them, both tables have a column category_no, and nothing I've tried so far seems to work.
The code I have so far is:-
Require_once('config.php');
Mysql_connect(db_host, db_user, db_password);
@mysql_select_db(db_database) or die( "unable to select database");
$query="select * from categories";
$result=mysql_query($query);
$num=mysql_numrows($result);
Mysql_close();
Thanks
Pete