У меня есть оператор выбора PDO, который успешно выполняется, rowCount
равен 1, но если я делаю fetchAll
, он возвращает []. Также fetch
возвращает false
.
Вот код
$st = $this->prepareQuery(
"select table.* from table where
type = 'OFFER' and
active = true and
platform = ? and
id not in (select users_table. table id from users_table where users_table.user_id = ?)");
if($st->execute([$platform, $user["user_id"]])){
echo "success";
echo $st->rowCount(); // 1
echo json_encode($st->errorInfo()); //["00000",null,null]
echo json_encode($st->errorCode()); //00000
echo json_encode($st->fetchAll()); // []
echo json_encode($st->fetch()); // false
} else echo "failure";
return $st->fetchAll(PDO::FETCH_NAMED);
Это работает на локальной машине (MacOS php 7.3), но на рабочем сервере (php 5.x ).