Re: Generating pages with full stories
| From: | J R | Date: | Tue, 14 Nov 2006 02:45:17 +0000 |
| Subject: | Re: Generating pages with full stories | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-42671@lists.php.net to get a copy of this message | ||
Here's how you should do this (IMHO):
On you front page make a sql query say you want to display the latest 3
events. Your query probably will look like this:
select event_table_id, title from event_table order by date_created desc
limit 3;
then from the result make a while or for loop (for example your result is
stored in an array $aResult)
foreach ($aResult as $value) {
echo '<a
href="eventFullStories.php?eventId='.$value['event_table_id'].'">'.$value['title'].'</a>;
}
Then on your eventFullSyories.php just query the event_table for that
eventId and display the event full story.
hth,
john
On 11/14/06, dancemaniac@edsamail.com.ph <dancemaniac@edsamail.com.ph>
wrote:
I'd answer question number 3. Well, it is just about an update section that the administrators will input on the database for updates and event for a company, saying the website has an updated page or simply putting an "event" for the public to know. Right now, I want to know how get a URL like this: http://www.myhomepage.com/thispage.php?variable1=value_X&?var2=val_Y Using anchor (link) tags, not from form tags. Yes... But, the experts on this list need more info in order to help you out. 1. Where are the stories going to come from? If you plant to take news stories from other sites and use them on your own site, there are serious legal issues involved. 2. If you want to write the stories yourself, or invite visitors to write your stories, then you probably want a simple content management system using PHP and MySQL. There are a lot of them about. Google or ask for recommendations. 3. If you'd prefer to make the site yourself in order to learn PHP + MySQL programming, you can find lots of tutorials. Google PHP Tutorials and look around. Good luck, Jeffrey dancemaniac@edsamail.com.ph wrote:-- GMail Rocks!!!-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpI've got a website using PHP and MySQL. I would like to make a "news preview" on the webpage's frontpage with a link to the full story. Is it possible to use one (1) .PHP file to generate full stories, with MySQL involved? I'm just a newcomer in the world of PHP but I am doing my best in reading materials for PHP. Thanks in advance.