PDA

View Full Version : Joining tables


percept
01-08-2004, 03:10 AM
I'm trying to get the results of a query to be <= users input where two tables are required for getting the results. When I test the query I get every row in my database even if > users input.

The query I'm using is:
$get_prods = "select * from products,prod_items WHERE products.prod_name = prod_items.prod_name and prod_items.item_points <= '$num_points' order by products.city, products.prod_name";

Can anyone see anything obviously wrong with this? is there perhaps a better way to do this? I'm somewhat (okay totally) confused about whether to use inner, outer, left, right joins and so I used this generic join.

Thanks for any help...

percept
01-08-2004, 04:10 AM
sorry, my problem is not just in this select query but also further into my code...

PLEASE IGNORE THE ABOVE (rookie here)