Php mysql按第三个顺序连接三个表

Php mysql按第三个顺序连接三个表,php,mysql,Php,Mysql,我有一个问题 SELECT jss_products.* from jss_products_tree,jss_products WHERE stock!=0 AND jss_products.productID = jss_products_tree.productID and sectionID=1 order by price 这给了我一个大的产品数组。现在我需要加入第三个表jss\u外部字段\u值, 它有productID和content字段,并以某种方式根

我有一个问题

   SELECT jss_products.* from jss_products_tree,jss_products 
   WHERE stock!=0 AND
   jss_products.productID = jss_products_tree.productID 
   and sectionID=1 order by price
这给了我一个大的产品数组。现在我需要加入第三个表jss\u外部字段\u值,
它有productID和content字段,并以某种方式根据第三个表中的内容对数组排序。此外,它可能有多行内容不同但product.ID.相同。。有没有关于如何加入他们的想法?我试过很多教程,但没有一个对我有帮助。。谢谢

它更容易使用,请从表1、表2中加入,因为它更易于阅读。你可以加入第三张桌子

SELECT jss_products.* from jss_products_tree
INNER JOIN jss_products 
  ON jss_products.productID = jss_products_tree.productID 
INNER JOIN jss_extrafields_values
  on jss_extrafields_values.productId = jss_products.productID
WHERE stock!=0 AND   
and sectionID=1 
order by jss_extrafields_values.field

如果您做错了,您应该向我们提供表的结构。请阅读关于syntaxIts的文章,没有错,最好是阅读tho