Issue when trying to use IN() in wpdb

后端 未结 4 1376
旧时难觅i
旧时难觅i 2020-11-28 13:52

i have this:

$villes = \'\"paris\",\"fes\",\"rabat\"\';
$sql    = \'SELECT distinct telecopie FROM `comptage_fax` WHERE `ville` IN(%s)\';
$query  = $wpdb->         


        
4条回答
  •  一整个雨季
    2020-11-28 14:10

    The prepare function also takes an array as the second parameter.

    You can try converting $villes like this:

    Current

    Change it to

    
    

    Now, try passing $villes to the prepare func and see if it works. Hope it helps.

提交回复
热议问题