scottybwoy Posted September 30, 2008 Share Posted September 30, 2008 Hi I have two tables, one called products, the other availability. I want to extract the availability_id_out_of_stock value and use it to get availability_name out of the availability table using the products_id in the products table. But this statement doesn't work : SELECT a.availability_name, p.products_quantity FROM availability a INNER JOIN products p ON p.availability_id_out_of_stock = a.availability_id WHERE p.products_id = 51 AND a.language_id = 1 So to clarify the tables, I'll draw them out here: Products... products_id | availability_id_out_of_stock ------------------------------------------- 51 | 2 52 | 3 Availability... availability_id | language_id | availability_name -------------------------------------------------- 2 | 1 | Temporarily out of stock 3 | 1 | 2 - 3 Days Sorry just trying to get my head round Joins, not sure if it the correct one or what way the fields should go. I'd be greatfull if someone could point me in the right direction. Thanks. Link to comment https://forums.phpfreaks.com/topic/126414-solved-is-this-query-correct/ Share on other sites More sharing options...
fenway Posted October 2, 2008 Share Posted October 2, 2008 Please post your solution. Link to comment https://forums.phpfreaks.com/topic/126414-solved-is-this-query-correct/#findComment-655283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.