2012-02-26 73 views
0

我有一個數據庫,可以在NHL中顯示一個賽季的最終分數。這是我的代碼,但我只想顯示最近20場比賽的比賽。任何幫助?顯示在分貝中玩過的最後20場比賽

$query = 'SELECT id, date, concat(right(date, 4), mid(date, 4, 2), left(date, 2)) AS concat_date, home, away, homescore, awayscore FROM gamestats12 WHERE date <> \'date\' ORDER BY concat_date DESC LIMIT 20'; 

感謝您的幫助。

+0

什麼數據庫? 。 – 2012-02-26 20:24:11

回答

0
$query = 'SELECT id, date, concat(right(date, 4), mid(date, 4, 2), left(date, 2)) AS concat_date, home, away, homescore, awayscore FROM gamestats12 WHERE date <> \'date\' ORDER BY date DESC LIMIT 0,20'; 
+0

這樣做。非常感謝... – user1234317 2012-02-27 00:58:28

0

考慮\'date\'

去除反斜線(\),你可以使用DATE_FORMAT代替3 equalient SUBSTR的。