Coldfusion : Select Data Using List

Cara memilih data dalam format list, seperti contoh 1,2,3 kedalam database yang menggunakan IN contoh IN (‘1′,’2′,’3’)

//tambah ' pada setiap data

        

   SELECT book_id,title FROM T_BOOK WHERE 0=0
   AND T_BOOK.BOOK_ID in (#PreserveSingleQuotes(mylist)#)

//coldfusion problem bila tambah ' dia akan bertukar ke ", jadi kena guna PreserveSingleQuotes untuk convert

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *