I have a database that I am successfully querying to display all rows where the value of one field equals x. What I need to do now is ONLY display the first 5 records that meet that criteria.
Here is my sql query so far:
$result = mysql_query("SELECT Player, Team, Pass_Yds, Pass_TDs, Int_Thrown, Rush_Yds, Rush_TDs, Overall_Pts, Total_Fantasy_Pts FROM ff_projections WHERE Position = 'QB' ORDER BY Pass_Yds DESC;");
I tried adding LIMIT 0,5 to the query (after DESC but before the ';') but then it wouldn't display anything at all.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…