Help fetching data with PHP

Discussion in 'MySQL' started by adamjthompson, Jan 5, 2007.

  1. #1
    Hello,

    Can someone refer me to a good tutorial on more advanced data fetching from MySQL with PHP?

    Specifically, I want to be able to only fetch and display a certain number of results, such as the first 10 rows of data in the table. None of the tutorials I've found cover this...

    Any help would be appreciated.

    ~Adam
     
    adamjthompson, Jan 5, 2007 IP
  2. AndrewR

    AndrewR Peon

    Messages:
    108
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    To show the first 10 rows, use this in your query: "LIMIT 0,10"
    $query = "SELECT * FROM foo LIMIT 0,10";
    PHP:
     
    AndrewR, Jan 5, 2007 IP
    adamjthompson likes this.