Search notes:

SQL precedence (AND, OR)

In most RDMBS (all?), and has a higher precedence than or when used in a where clause.
Because of this precedence rule, and conditions are evaluated before or conditions.
where condition is true:
select count(*) from …
where
   1 = 1            or
   1 = 2 and 1 = 3
;
where condition is false
select count(*) from …
where
   1 = 0            or
   1 = 1 and 1 = 3
;

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758207169, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL/where/precedence/index(50): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78