SQL Table Join

Discussion in 'PHP' started by Silver89, Apr 11, 2008.

  1. #1
    Hi,

    I have a database that has two tables,
    One is: results
    The other: news

    I have a page called news.php and results.php where the latest news is called by the most recent date and the other does the same but with the latest results.

    On the index i would like to call both tables and sort the rows by date, can this be done?

    Thanks
     
    Silver89, Apr 11, 2008 IP
  2. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is there a field linking the two tables? If not use two queries to get each. If there is a link then do something like "WHERE news.field_name=results.field_name2 ORDER BY date_field"
     
    LogicFlux, Apr 11, 2008 IP