I have the following query that pulls out data to make up a navigation menu.
SELECT id, btn_txt FROM navigation WHERE parent="'.$parent.'";
I would like to condition this further by only pulling out those results that are 'enabled'. The problem is that the my 'status' column holding the information 'enabled' or not is in a different table called 'pages'.
how could I rewrite the above query to accomplish WHERE parent = $parent AND status = "enabled" [although status is in a separate table].
I am using MySQL 4.1.
I looked at a couple tutorials off Google search for mysql join, but i didn't fully understand.
I scrapped together this query
SELECT n.id, n.btn_txt, p.status FROM navigation n, pages p WHERE n.parent="'.$parent.'" AND p.status="enabled";
..but, it repeatedly displayed the results 12 times over... and still displayed results that were not 'enabled'.
Hope you can help.
Thank-you.