If my pdo query like:
$sql=$pdo->prepare('select timezone from wo_users where user_id=?')->execute(array($wo['user']['user_id']));
while($row=$sql->fetch()){var_dump($row);die;}
Will throw an error:
( ! ) Fatal error: Call to a member function fetch() on boolean in C:\wamp64\www\community.voyance\2\sources\calendar.php on line 27
But if my pdo query that uses query() directly will not throw error:
$sql=$pdo->query('select timezone from wo_users where user_id=1;');
while($row=$sql->fetch()){var_dump($row);die;}
C:\wamp64\www\community.voyance\2\sources\calendar.php:27: array (size=1) 'timezone' => string '-8' (length=2)
Why is this happening? Thanks!