Jump to content

[SOLVED] php posting script


sheridan

Recommended Posts

i'm about to try to start on the development of a script that when you type in a textarea at the bottom of a news page, it will post it up on the news site (basically a forum in that aspect) but also i want the news page to show the last 5 posts and then have pages of history after that point. i'm wanting to know the basic concept of doing something like this.

 

i'm probably completely wrong, but i'm thinking querying the database for all entries and using pagination on those queries. but i'm trying to think of how to do that without it being a million different queries? i realize it'll probably use the incrementing ID, then i want to store author, time posted, and message of course, and a title. i know how to set it up database side i believe. just i don't know the best way to pull the information i want without having a lot of overhead or something

Link to comment
Share on other sites

to get  the last five

 

mysql_query('SELECT news FROM table name ORDER BY newsid DESC LIMIT 5');

 

ON PAGING

mysql_query('SELECT news FROM table name ORDER BY newsid DESC LIMIT put starting vaue, put ending value'); :-*

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.