firethrottle Posted August 27, 2007 Share Posted August 27, 2007 hey, how do i make a next link in an articles system? i know you can just do $nextid = $_get[id] + 1; or whatever, but what if the next id doesn't exist? (eg article not approved, or has been deleted). so in essence, what i am asking is how do you get the next existing id from a database? thanks in advance Link to comment https://forums.phpfreaks.com/topic/66849-solved-next-links-in-an-articles-system/ Share on other sites More sharing options...
AndyB Posted August 27, 2007 Share Posted August 27, 2007 Typically with a query like SELECT id WHERE article_status = 'OK' AND id > '$current_id' ORDER by id ASC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/66849-solved-next-links-in-an-articles-system/#findComment-335136 Share on other sites More sharing options...
firethrottle Posted August 27, 2007 Author Share Posted August 27, 2007 oh ok. thanks, i never thought of that. i'll try it, it looks like it will work. Link to comment https://forums.phpfreaks.com/topic/66849-solved-next-links-in-an-articles-system/#findComment-335172 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.