Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Exclamation [PHP] News System - Help!

    Hello, i need a system for this mindmap i made, its for showing news and i want them to be sorted by id and max 3 news

    my mindmap:


    does anyone have experience to do such a system?
    Last edited by epxine; 11-17-2011 at 05:28 PM.

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,445
    Thanks
    71
    Thanked 102 Times in 101 Posts
    Do you just want a simple while loop with a max of 3 records?
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #3
    New Coder
    Join Date
    Nov 2011
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by myfayt View Post
    Do you just want a simple while loop with a max of 3 records?
    ok simple while loop if possible

  • #4
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,445
    Thanks
    71
    Thanked 102 Times in 101 Posts
    Something like this? (Customize it to your coding)

    PHP Code:
    $query mysql_query("SELECT * FROM news WHERE id>'0' ORDER BY topic_date DESC LIMIT 3");

    while (
    $row mysql_fetch_array($query)) {
    echo 
    "Topic Title ".$row['topic_title']."<br />
    Topic Content "
    .$row['topic_content']."<br />
    ETC"
    ;

    Been a sign maker for 7 years. My business:
    American Made Signs


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •