【问题标题】:In Laravel 4.2 Running A Select Query using DB::select() throwing Error on cpanel在 Laravel 4.2 中使用 DB::select() 运行选择查询,在 cpanel 上抛出错误
【发布时间】:2016-03-27 08:33:36
【问题描述】:

在 localhost 中一切正常,但上传到 Cpanel 后会抛出类似的错误

SQLSTATE[42S02]:未找到基表或视图 注意:我使用DB::select(); 编写了一个查询

查询如下:

         $general_product_report = DB::select('SELECT X.Product_ID,X.Product_Name,X.Product_Description,X.Count_StockIN,IFNULL(Y.Count_StockOut,0) Count_StockOut,(X.Count_StockIN-IFNULL(Y.Count_StockOut,0)) Balance FROM ( SELECT M.product_ID,M.Product_Name,M.Product_Description, SUM(Product_Count) AS Count_StockIN from (SELECT A.*,B.Product_Name,B.Product_Description FROM `stock_in` A, `products` B where A.Product_ID=B.Product_ID )M group by Product_ID,Product_Name,M.Product_Description ) X LEFT JOIN ( SELECT product_ID, SUM(Product_Count) AS Count_StockOUT from `stock_Out`group by Product_ID ) Y On X.Product_ID=Y.Product_ID');

【问题讨论】:

    标签: php mysql laravel-4 composer-php


    【解决方案1】:

    您需要验证表stock_Out 是否存在。

    【讨论】:

      猜你喜欢
      • 2019-10-25
      • 1970-01-01
      • 1970-01-01
      • 2012-09-16
      • 2017-03-16
      • 2020-03-27
      • 2017-10-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多