Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 全局MySQL查询获取行_Php_Mysql - Fatal编程技术网

Php 全局MySQL查询获取行

Php 全局MySQL查询获取行,php,mysql,Php,Mysql,大家好,我有一个全局mysql查询 $table_res = mysqli_query($GLOBALS["___mysqli_ston"], "SELECTtProduct.sProduct, tManufacturers.sManufacturer, tSerie.sSerie, tApplication.sType, tApplication.sEngine, tApplication.sKiloWatt, tApplication.sHorsePower, tApplication.s

大家好,我有一个全局mysql查询

$table_res =  mysqli_query($GLOBALS["___mysqli_ston"], "SELECTtProduct.sProduct, tManufacturers.sManufacturer,
tSerie.sSerie, tApplication.sType, tApplication.sEngine, tApplication.sKiloWatt, tApplication.sHorsePower,
tApplication.sDate1, tApplication.sDate2 FROM tProduct INNER JOIN (tSerie INNER JOIN (tManufacturers INNER JOIN 
(tApplication INNER JOIN tApplicationProduct ON tApplication.nApplication = tApplicationProduct.nApplication) ON 
tManufacturers.nManufacturer = tApplication.nManufacturer) ON tSerie.nSerie = tApplication.nSerie) ON 
tProduct.nProduct = tApplicationProduct.nProduct WHERE sProduct = '$product'
ORDER BY tProduct.sProduct;");

我怎样才能从这个查询中获取行和字段呢?请记住,这个查询忽略了
Where
参数。

也许你想要这样的东西,尽管坦率地说,我觉得这个命名策略有点疯狂

SELECT p.sProduct 
       , m.sManufacturer
       , s.sSerie
       , a.sType
       , a.sEngine
       , a.sKiloWatt
       , a.sHorsePower
       , a.sDate1
       , a.sDate2 
    FROM tProduct p
    JOIN tApplicationProduct ap
      ON ap.nProduct = p.nProduct 
    JOIN tApplication a
      ON a.nApplication = ap.nApplication
    JOIN tSerie s
      ON s.nSerie = a.nSerie
    JOIN tManufacturers m
      ON m.nManufacturer = a.nManufacturer
   WHERE p.sProduct = '$product' 
   ORDER 
      BY p.sProduct;

该查询在功能上是无用的。。。所以,修复它。where在完全错误的位置
选择where
where应该在from子句之后或连接之后使用,但不能在选择之后使用。您在这里发现了什么问题?我们应该修复什么?几乎,现在将where语句放回查询中,在order by语句之前,告诉我们您需要什么帮助!我想知道是否可以从此查询中获取所有表的行?