bundle:id   bundle     price
i    A,B,C,      0.88use an array to get the products user buyed:  sort($buyed[])$first = $buyed[0];"select * from bundle where bundle like '".$first.",%'"then make each result be an array : $bundle  finally, if(array_intersect($bundle,$buyed) == $bundle)....

解决方案 »

  1.   

    先谢谢两位大虾的指教lantersen(蓝水仁)和zeroleonhart(Strong Point:Algorithm) 的方法都不错,简直让我茅塞顿开!
    zeroleonhart那个bundle表,如果想某个产品是两个的,譬如两个A搭配一个B,应该怎样做?是在bundle字段写入A,A,B还是多增加一个字段
    id   bundle   qty  price
    i    A,B      2,1  0.88我马上去试试先,解决了就回来给分
      

  2.   

    如果想某个产品是两个的,譬如两个A搭配一个B,应该怎样做?在bundle字段写入A,A,B-------------------------use this