次のクエリは、phpmyadminから実行すると、期待どおりに1行を返します。
SELECT units . * , locations . *
FROM units, locations
WHERE units.id = '1'
AND units.location_id = locations.id
LIMIT 0 , 30
しかし、私がコハナ3でそれをやろうとすると:
$unit = DB::select('units.*', 'locations.*')
->from('units', 'locations')
->where('units.id', '=', $id)->and_where('units.location_id', '=', 'locations.id')
->execute()->as_array();
var_dump($unit);
印刷します
array(0){}
私は何が間違っているのですか?