WHERE post_status_flag = 1 AND posts.post_id != 231
といったSQLをFuelPHP 1.7で実現したいです。
以下のように書いています。
$query = DB::select( 'post_id', 'text' ) ->from('posts') ->join('restaurants', 'INNER') ->on('posts.post_rest_id', '=', 'restaurants.rest_id') ->join('users', 'INNER') ->on('posts.post_user_id', '=', 'users.user_id') ->join('categories', 'LEFT OUTER') ->on('posts.post_category_id', '=', 'categories.category_id') ->join('tags', 'LEFT OUTER') ->on('posts.post_tag_id', '=', 'tags.tag_id') // ->where_open() ->where('post_status_flag', '1') ->and_where('posts.post_id', '!=' '231')// ここでエラーになる。 // ->where_close() ->order_by('posts.post_date','desc') ->limit("$limit");
->and_where('posts.post_id', '!=' '231')とするとでエラーになるため、
現在は削除しています。
どうすれば実現できますでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/07/29 05:54