How to pass array in php PDO select query

Here I am using implode statement to qualification but i want to select that qualified people in the query…

I want to here show people who are all educated either SSLC or PUC or BCA …


    eg:  $my_explode=SSLC,PUC,BCA
    $query1 = ' SELECT * FROM `tbl_user_reg`   WHERE    qualification in(:qualification) ';
    $query2 = $conn->prepare($query1);
    $result = $query2->fetchAll(PDO::FETCH_ASSOC);
    foreach($result as $disel):

But here not working the query …,

any suggestion please…!


Only values can be supplied via prepared query place-holders, not sql syntax. The commas between the values are part of the sql syntax. Therefore, you must supply a separate prepared query place-holder for piece of data.

This is actually addressed in the documentation. See example #5 at this link -

Sponsor our Newsletter | Privacy Policy | Terms of Service