在我的控制器中,我有以下代码:
if($action=='shipping_list'){
$numrows=inquire_row(); //Get number of rows in query
$pages= new Paginator('10', 'p'); //create object
$pages->set_total($numrows);
$shipping=shipping_list(); //Goes to model
include('shipping_list.php');
}
在我的模型中,我有这些代码:
function shipping_list(){
global $MEMS;
global $pages;
$query = "SELECT * FROM Inventory" .$pages->get_limit()
."WHERE Yield >=320 AND (Q = 'Pass' OR Q='No Q') AND shipdate = ' '
ORDER BY Wafer ASC, RC ASC";
echo $query;
$shipping = $MEMS -> query($query);
var_dump($shipping);
return $shipping;
}
当我回显 $query 时,我得到
SELECT * FROM Inventory LIMIT 0, 20 WHERE Yield >=320 AND (Q = 'Pass' OR Q='No Q') AND shipdate = ' ' ORDER BY Wafer ASC, RC ASC
所以我知道到目前为止一切都是正确的。但是,当我 var_dump $shipping 时,我得到 bool(false)。为什么我的查询没有返回正确的结果?