My scenario:
- I want to post all threads from a table in my DB, except for the very last one. I've tried to use
select_max
, but it doesn't work. I can't seem to figure out what to put in my query string.
I just want to retrieve all posts and offset it by 1.
Something like this might work:
SELECT * FROM table ORDER BY id DESC LIMIT 100,1
(limit 100, offset by 1)
or you get all the posts and in when looping through them in codeigniter you could do something like this:
$i = 1;
foreach($posts as $p):
if($i != 1):
//show posts
endif;
$i++;
endforeach;
精彩评论