$rs = $pbc->selectPublication(filter_input(INPUT_GET, 'id', FILTER_DEFAULT));
I have this code that is passed as method argument to select the posts in the system, but how can I use it with ternary, if it returns true and is filtered without problems pass the value, or if it gives any problem, send 0?
My select class:
$selectSQL = $this->pdo->prepare('SELECT values WHERE id = ? LIMIT 1');
$selectSQL->bindValue(1, $codigo, PDO::PARAM_INT);
$selectSQL->execute();
$row = $selectSQL->fetch(PDO::FETCH_ASSOC);
return $row;