Skip to content

Example of IN statement #7

@aggarwaldev

Description

@aggarwaldev

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions