我现在的sql是:select $user_id from table where = $goods_id
------------------------------------------------------------------------------
这能执行?

解决方案 »

  1.   

    select 2 from table where goods_id = 44 (意思是:从goods_id为44的条目中寻找是否有user_id为2的数据)
    --------------------------------------------------------------------------------------------------------
    谁解释的意思?
      

  2.   

    "从goods_id为44的条目中寻找是否有user_id为2的数据"
    这样行不行?
    select * from table where goods_id = 44 and user_id=2
      

  3.   

    解释的问题很严重。按你的意思,应该是这样:
    select * from table where goods_id = 44 and user_id = 2