Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: display mysql entries on site?

  1. #11
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    you must say:

    $query = mysql_query("SELECT * FROM `table` ORDER BY 'date' DESC") or die(mysql_error());

    I think you must say ORDER BY

  2. The Following User Says Thank You to auriaks For This Useful Post:

    liamallan (02-16-2010)

  3. #12
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Yes, order by is a must, but we dont know if he has a date column.
    Jeremy | jfein.net

  4. #13
    Join Date
    Feb 2010
    Location
    Falkirk, Scotland
    Posts
    142
    Thanks
    21
    Thanked 4 Times in 4 Posts

    Default

    no, just name and profile. will i need to add an id or date column?

  5. #14
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Yes. In PHPmyadmin click on the table you're using and then press SQL and put this code in:
    Code:
     ALTER TABLE `table-name` ADD `id` INT NOT NULL AUTO_INCREMENT ,
    ADD PRIMARY KEY ( `id` )
    Then for the query:
    Code:
    $query = mysql_query("SELECT * FROM `table` ORDER BY 'id' DESC") or die(mysql_error());
    Jeremy | jfein.net

  6. The Following User Says Thank You to Nile For This Useful Post:

    liamallan (02-16-2010)

  7. #15
    Join Date
    Feb 2010
    Location
    Falkirk, Scotland
    Posts
    142
    Thanks
    21
    Thanked 4 Times in 4 Posts

    Thumbs up

    thanks guys, working perfect now! top dollar!

  8. #16
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Glad to help you! Your welcome!

    It seems your topic is solved... Please set the status to resolved.. To do this:
    Go to your first post ->
    Edit your first post ->
    Click "Go Advanced" ->
    Then in the drop down next to the title, select "RESOLVED"
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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