2014-01-14 16 views
-3

任何人都可以通過描述這個PHP MySQL命令請幫助: -意義的大型mysql命令

SELECT itm.*,mem.username as username,cpn.* 
    FROM aw_rdw_items itm,members mem,aw_rdw_items_coupons cpn 
    WHERE itm.item_id=cpn.item_id 
     and item_special_type != 'g' 
     and itm.item_id=cpn.item_id 
     and itm.memberid=mem.memberid 
     and item like('%".addslashes($_REQUEST["item_name"])."%') 
     $prs1 $prs2 $greenget $subsql 
    ORDER BY Display_Order,itm.item_id ASC 
+0

簡單。這個php mysql命令是錯誤的。 – Strawberry

+0

當你的問題低於恆星時,請求專家的答案是......不太可能最終結束。 –

+0

請提出一個新問題,而不是對此進行徹底編輯。 – showdev

回答

0
SELECT 
    itm.*, // all columns of table itm 
    mem.username as username, // column username and assign the values to a variable called username 
    cpn.* // columns of table con 
FROM aw_rdw_items itm, members mem, aw_rdw_items_coupons, cpn // tables where execute the research 
WHERE itm.item_id=cpn.item_id // various conditions 
    and item_special_type != 'g' 
    and itm.item_id=cpn.item_id 
    and itm.memberid=mem.memberid 
    and item like('%".addslashes($_REQUEST["item_name"])."%') // item must contain the specified variable 
    $prs1 $prs2 $greenget $subsql // some php variables 
ORDER BY Display_Order, itm.item_id ASC // order by Dispay_Order and itm.item_id in ascendant mode 
+0

我剝大部分PHP的一部分,以使SQL語法高亮和固定SQL – Geoffroy

+0

感謝註釋語法,但實際上我沒有ITM表在我的數據庫 – user3098533

0

返回所有記錄誰item_special_type是從"g"item不同包含item_name請求值值。

Where子句中包含另一個條件,包含$prs1,$prs2,$greenget$subsql變量。