Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7

Thread: News Problem :(

  1. #1
    Join Date
    Aug 2004
    Location
    Over there. ^_^
    Posts
    1,100
    Tokens
    0

    Latest Awards:

    Default News Problem :(

    Right on my news system i want to show the news titles and who the article is by in the the updates box, this strangely only works if your on the news page :s when i want it to work on all pages, anybody know whats wrong ! :s the page to show all of the news this is the source

    the only page it works on is
    www.xenigma.co.uk/index.php?page=news/viewnews

    PHP Code:
     <?
    include("dbconnect.php");//include the file to connect to the database
    $getnews mysql_query("SELECT 10 FROM mynews ORDER BY id DESC");//query the database for all of the news

    while($r=mysql_fetch_array($getnews)){//while there are rows in the table
    extract($r);//remove the $r so its just $variable

    echo("MY NEWS LAYOUT!!!");

    }

    ?>
    the variables are

    $title - the news' title
    $user - who added the news
    $date - Month/Day/Year
    $message - news itself

    and the page to show the updates is:

    PHP Code:
     <?
    include("news/dbconnect.php");//include the file to connect to the database
    $getnews mysql_query("SELECT 5 FROM mynews ORDER BY id DESC");//query the database for all of the news

    while($r=mysql_fetch_array($getnews)){//while there are rows in the table
    extract($r);//remove the $r so its just $variable

    echo("$title by $user<br>");

    }

    ?>
    anybody know whats up this is probably one of my nooby mistakes which ill either realise at the last moment or somebody points it out to me and laughs at me like a noob

    Please Help
    xEnigmA
    *Image Removed


    Ahemm.. How exactly was my sig innapropriate?
    Goddamit i hate this forum :@
    I RESIGN FROM GRAPHICS DESIGNER :@ :@ :@

  2. #2
    Join Date
    Aug 2004
    Location
    Over there. ^_^
    Posts
    1,100
    Tokens
    0

    Latest Awards:

    Default

    Ignored Bump ^^

    Edit by Urges - Please do not double post, Simply edit your last one. Thanks
    Last edited by Urges; 04-08-2005 at 05:26 PM.
    *Image Removed


    Ahemm.. How exactly was my sig innapropriate?
    Goddamit i hate this forum :@
    I RESIGN FROM GRAPHICS DESIGNER :@ :@ :@

  3. #3
    Join Date
    Jul 2004
    Location
    Sunshine Coast, Queensland, AU
    Posts
    1,830
    Tokens
    467

    Latest Awards:

    Default

    can u show me in better detail and i'll have a look

  4. #4
    Join Date
    Aug 2004
    Location
    Over there. ^_^
    Posts
    1,100
    Tokens
    0

    Latest Awards:

    Default

    can i show you what in better detail? im giving you the source of whats on the news page and whats on the page were the updates are

    what more can i give!
    *Image Removed


    Ahemm.. How exactly was my sig innapropriate?
    Goddamit i hate this forum :@
    I RESIGN FROM GRAPHICS DESIGNER :@ :@ :@

  5. #5
    Join Date
    Aug 2004
    Location
    Over there. ^_^
    Posts
    1,100
    Tokens
    0

    Latest Awards:

    Default

    no help ^^ bump

    [Edited By Partie2] (Forum Moderator) please dont bump your posts it just wastes forum space!
    Last edited by partie2; 05-08-2005 at 05:47 PM.
    *Image Removed


    Ahemm.. How exactly was my sig innapropriate?
    Goddamit i hate this forum :@
    I RESIGN FROM GRAPHICS DESIGNER :@ :@ :@

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    You mysql is wrong
    $getnews = mysql_query("SELECT 5 FROM mynews ORDER BY id DESC");

    its only selecting a row called 5 wich there probly isnt, what i think u want is

    $getnews = mysql_query("SELECT * FROM mynews ORDER BY id DESC LIMIT 5");

  7. #7
    Join Date
    Aug 2004
    Location
    Over there. ^_^
    Posts
    1,100
    Tokens
    0

    Latest Awards:

    Default

    thanks again mentor!
    *Image Removed


    Ahemm.. How exactly was my sig innapropriate?
    Goddamit i hate this forum :@
    I RESIGN FROM GRAPHICS DESIGNER :@ :@ :@

Posting Permissions

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