$id ='123';
$id_c = "%$id%";
$stmt = $db->prepare("SELECT * FROM user_s WHERE id LIKE ?");
$stmt->execute(array($id_c));
$data = $stmt->fetchAll();
foreach ($data as $item) {
if ($item['id'] != $id'') {
} elseif {
}}
echo "<pre>\n";
print_r($data);
echo "</pre>\n";
SELECT EXISTS(SELECT 1 FROM test2 WHERE id ='321321' LIMIT 1)
$stmt = $dbh->prepare('SELECT EXISTS(SELECT 1 FROM user_s WHERE id =:id LIMIT 1)');
$stmt->bindValue(':id', $id, PDO::PARAM_INT);
$stmt->execute();
if ($stmt->fetch(PDO::FETCH_NUM)) {
// exists
}