I am trying to use like operator with condition but it is showing null values
Just like operator is working
$query = $conn->prepare(‘SELECT * FROM user_registration user_name LIKE ? and user_email LIKE ? and user_mobile LIKE ?’);
$query->bindValue(1, “%$f_name%”, PDO::PARAM_STR);
$query->bindValue(2, “%$emailn%”, PDO::PARAM_STR);
$query->bindValue(3, “%$mobilen%”, PDO::PARAM_STR);
$query->execute();
but i want to add created_by = 2 in the query
i tried like this but it wont work (showing null values)
$query = $conn->prepare(‘SELECT * FROM user_registration WHERE created_by = ? and user_name LIKE ? and user_email LIKE ? and user_mobile LIKE ?’);
$query->bindParam(4, $created_by );
$query->bindValue(1, “%$f_name%”, PDO::PARAM_STR);
$query->bindValue(2, “%$emailn%”, PDO::PARAM_STR);
$query->bindValue(3, “%$mobilen%”, PDO::PARAM_STR);
$query->execute();
what i did wrong…?
thank you,