Jump to content


Definition help


4 replies to this topic

#1 jamiecarter

    Young Padawan

  • Members
  • Pip
  • 85 posts

Posted 04 July 2006 - 07:22 PM

Basically i've searching for tutorials where your main webpage shows for example, the 5 latest news articles you've uploaded to a mysql database.

what is this called, my guess is rss feeding?

Thx for help

#2 Erik Bernskiold

    Jedi In Training

  • Members
  • PipPip
  • 422 posts
  • Gender:Male
  • Location:Gothenburg, Sweden
  • Interests:I love to do booth Web Design and Photography. Nothing beats a nice day out in the nature with the camera gear, getting loads of nice photos. I have been playing the flute for 6 years now and I love it, and I am playing the pipe organ as well. I also like to teach other people the in and outs of software such as the CS3 suite from Adobe.

Posted 05 July 2006 - 03:47 AM

Do you mean, like displaying 5 things from a database?

In that case it is mySQL all the way, displaying from the database is what you want to do. There is a fair few good tutorials on that in the database here.

(Any mod, this should more be in PHP Help section?)

#3 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 05 July 2006 - 05:48 AM

topic moved to PHP section.

RSS is a way for people to keep a track of new updates on your website, like adding new photos or adding new pieces of news.

Like Erik said you want to use php and mysql to pull out and display the newest records:

<?php

require_once('mysql_connect.php'); // database connection file

$result = mysql_query("SELECT * FROM `table` ORDER BY `id` DESC LIMIT 0,5"); // pull out the news articles from the table
$num = mysql_num_rows($result); // how many rows are there?

if ($num) { // if there are any rows

while ($row = mysql_fetch_array($result)) { // put the results into an array ready to be displayed

echo "put how you want it to be displayed in here"; // display each news article

} 

} else { echo "There are no news articles in the db"; } // error message is there are no news articles in db

?>

Matt

#4 jamiecarter

    Young Padawan

  • Members
  • Pip
  • 85 posts

Posted 05 July 2006 - 06:45 AM

thanks guys, now i understand :)

#5 Erik Bernskiold

    Jedi In Training

  • Members
  • PipPip
  • 422 posts
  • Gender:Male
  • Location:Gothenburg, Sweden
  • Interests:I love to do booth Web Design and Photography. Nothing beats a nice day out in the nature with the camera gear, getting loads of nice photos. I have been playing the flute for 6 years now and I love it, and I am playing the pipe organ as well. I also like to teach other people the in and outs of software such as the CS3 suite from Adobe.

Posted 05 July 2006 - 09:07 AM

No problems, glad I could be of help.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users