Search notes:

SQLite: drop table

Dropping a table only if it exists

In order to suppress error messages, SQLite supports the drop table if exists clause which only tries to drop a table if it in fact does exist:
create table tq84_table (a, b, c);

drop table if exists tq84_table;

drop table if exists tq84_table;
Github repository about-sqlite, path: /tables/drop_if_exists.sql
See also Dropping a view only if it exists

See also

table
create table

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...', 1758204647, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/tables/drop(51): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78