0
<?php

require_once 'app/init.php';

$itemsQuery=$db->prepare("
    SELECT id, name, done
    FROM items
    WHERE user=:user 
    ");

$itemsQuery->execute([
    'user'=>$_SESSION['user_id']
]);

$items=$itemsQuery->rowCount() ? $itemsQuery : [];      

Hello, I was watching a tutorial on youtube and I have problems understanding " ? " and " : " in the last line of the code shown.

Thanks in advance for any help.

0 Answers0