PHP-DB icon indicating copy to clipboard operation
PHP-DB copied to clipboard

Example of IN statement

Open aggarwaldev opened this issue 6 years ago • 4 comments

Hi,

I have the following statement:

$result = $this->db->exec(
                    " SELECT userImage FROM candid WHERE id = ? AND status IN ? ",
                    [
                        $userid,
                        $status
                    ]
                );

And $status = array('active','idle');

I am unable to fetch results from database. I even tried changing $status from array to variable: $status = "'interview','pending'";

Can you please help?

Note: This is a question and not an issue.

aggarwaldev avatar Mar 31 '18 15:03 aggarwaldev