我有下面這段PHPPHP畸形查詢SQL 1064錯誤
的$manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";
$manufacturers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS_ADMIN, $manufacturers_query_raw, $manufacturers_query_numrows);
$manufacturers_query = tep_db_query($manufacturers_query_raw);
while ($manufacturers = tep_db_fetch_array($manufacturers_query))
{
if ((!isset($HTTP_GET_VARS['mID']) || (isset($HTTP_GET_VARS['mID']) && ($HTTP_GET_VARS['mID'] == $manufacturers['manufacturers_id']))) && !isset($mInfo) && (substr($action, 0, 3) != 'new')) {
$manufacturer_products_query = tep_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where manufacturers_id = '" . (int)$manufacturers['manufacturers_id'] . "'");
$manufacturer_products = tep_db_fetch_array($manufacturer_products_query);
$mInfo_array = array_merge($manufacturers, $manufacturer_products);
$mInfo = new objectInfo($mInfo_array);
}
我也得到網頁上的以下錯誤:
1064 - 你在你的SQL語法錯誤;請檢查與您的MySQL服務器版本相對應的手冊,以便在第1行'select manufacturers_id,manufacturers_name,manufacturers_image,date_added,la'處使用正確的語法。
select count(select manufacturer_id,manufacturer_image,date_added,last_modified from通過manufacturers_name廠家順序)的總
請幫助。非常感謝。
題外話:不要使用'$ HTTP_GET_VARS'。它已經過時(並且已經過時了很長時間)。改爲使用'$ _GET'。 – Spudley