https://www.codeenigma.com/community/blog/drupal-7-cheat-sheet-database https://www.drupal.org/update/modules/6/7Drupal 7的獲取相當於
我無法從Drupal的6包住我的頭周圍的變化 - > 7.
"SELECT CRS_sales.User, CRS_Goals.*,
sum(CRS_sales.CompUnits) as CompUnits,
sum(CRS_sales.KBUnits) as KBUnits,
sum(CRS_sales.PrinterUnits) as PrinterUnits,
sum(CRS_sales.MouseUnits) as MouseUnits,
Count(CRS_sales.Comp) as CompCount
sum(CRS_sales.CompUnits + CRS_sales.KBUnits + CRS_sales.PrinterUnits + CRS_sales.MouseUnits) as UnitsTotal,
FROM CRS_sales
INNER JOIN CRS_Goals
ON CRS_sales.User=CRS_Goals.User
WHERE date(CRS_sales.Created) = "01/10/2015" GROUP BY CRS_sales.User
order by UnitsTotal DESC";
我如何獲取這些信息儘可能多的行存在?
謝謝你的幫助。
的Drupal提供db_query($查詢)方法。你可以簡單地傳遞你的查詢。雖然這個方法也存在於drupal 6中。 –