I am trying to verify that my query is grabbing at least 1 row from the database.
$db = new SQLite3('../portfolio.db');
$results = $db->prepare('SELECT COUNT(*) FROM users WHERE id = :id');
$results->bindValue(':id', 7);
$grab = $results->execute();
if([COUNT(*) VALUE] == 1) {
echo "true";
}
What I'm trying to figure out is what could I replace [COUNT(*) VALUE] with in the if statement to echo out "true".
Anyone know how this is done? I assume there's a way to return the number of COUNT(*) but I'm not entirely sure.
The question similar to mine didn't work most likely because he/she is using regular mysql/php whereas this is PHP PDO and SQLite3.