Rayhan420 Posted February 8, 2016 Share Posted February 8, 2016 I have created a script that orders post form mysql database.i have used SELECT*From $tbl_name ORDER BY id DESC LIMIT 20 so,my page is showing only 20posts.but in next page i don't want to write the code manually.so help me with this one.i want the next content page to be created automatically & it will only hold 20post. Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/ Share on other sites More sharing options...
requinix Posted February 8, 2016 Share Posted February 8, 2016 The word you're looking for is pagination. Your SQL queries will look like SELECT * FROM $tbl_name ORDER BY id DESC LIMIT $offset, 20and $offset = ($page - 1) * 20 (assuming the first page is $page=1). Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530849 Share on other sites More sharing options...
Rayhan420 Posted February 8, 2016 Author Share Posted February 8, 2016 (edited) Will it automatically create the next content page?Like will it create <a href="next">next</a>&<a href="prev">prev</a> Edited February 8, 2016 by Rayhan420 Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530850 Share on other sites More sharing options...
requinix Posted February 8, 2016 Share Posted February 8, 2016 ...no. You will have to actually write code. Weird, huh? Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530853 Share on other sites More sharing options...
Rayhan420 Posted February 8, 2016 Author Share Posted February 8, 2016 How can i make any text in my database copyable with php Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530856 Share on other sites More sharing options...
requinix Posted February 8, 2016 Share Posted February 8, 2016 By making a new thread detailing whatever it is you're asking about. Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530857 Share on other sites More sharing options...
Rayhan420 Posted February 8, 2016 Author Share Posted February 8, 2016 Can you help me create a sms sharing php script.i am new to php.so,my every trial is going to waste.please if you could please share a sms sharing script. Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530870 Share on other sites More sharing options...
ginerjm Posted February 8, 2016 Share Posted February 8, 2016 Sounds more like you are new to programming in general as well as user forums. Â This forum is here to help people with their code - not to just hand out snippets of code to solve your problems. When you decide to settle down and teach yourself some stuff and can give us your attempt at a script, then you can ask for help with it. Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530884 Share on other sites More sharing options...
Rayhan420 Posted February 9, 2016 Author Share Posted February 9, 2016 Thank you all for your help. Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530896 Share on other sites More sharing options...
Solution ginerjm Posted February 9, 2016 Solution Share Posted February 9, 2016 Glad we could get you on the right track. Learning how to program is not just copying someone else's hard work. It's about learning which involves reading and understanding and practice. Kind of like everything in this world. Quote Link to comment https://forums.phpfreaks.com/topic/300752-need-help-to-create-dynamic-php-next-content-page/#findComment-1530912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.