This query seems to work perfect on my older machine. However, on my new machine with MySQL 5.7.14 and PHP 5.6.25 it seems to throw an error:
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[42000]: Syntax error or access violation: 1140 In aggregated
query without GROUP BY, expression #1 of SELECT list contains
nonaggregated column 'pixel_perfect.users.id'; this is incompatible
with sql_mode=only_full_group_by' in C:wamp64www
Here is what my query looks like:
$sql="SELECT id, password, COUNT(id) AS count FROM users WHERE email = :email LIMIT 1";
$stmt=$db->prepare($sql);
$stmt->bindValue(':email', $email);
$stmt->execute();
Why am I getting this error now and what do I do to resolve it painlessly.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…