HELP DISTINCT

wxdqz

New Member
Ok, I got myself in a jam here. In my testing stage I would query 1 table for data, and dynamically create a group of unique buttons from category_name. I used the DISTINCT keyword to Keep from non-unique buttons.
Now I JOIN tables and can not seem to get unique buttons. My syntax must be way off, I have tried moving the DISTINCT keyword around in the statement without any luck. I can display the page with what is below, but have multiple buttons.... HELP!
<PRE>

mysql_connect('localhost','user_name','password') or die ("Problem connecting to DataBase");
$query = "SELECT * FROM tbl_1 JOIN tbl_2 WHERE tbl_1.category_id=tbl_2.category_id HAVING tbl_1.contact_city='$City' AND ST='$ST'";
$result = mysql_db_query('db_nm', $query);
</PRE>

Thanks in advance!
Jim
 
Back
Top