April 2026
Intermediate
1009 pages
34h 15m
English
After all that theory, let’s revisit the popular practical application from the previous chapters, the guestbook. The individual files are adapted directly for SQLite so that you have an application specially tailored to this database.
To create the table, you can use the listings from Section 20.2.1 and Section 20.2.2 as a blueprint. The main functions are the SQLite3 constructor and exec().
<?php try { $db = new SQLite3("guestbook.db"); $sql = "CREATE TABLE guestbook ( id INTEGER PRIMARY KEY, heading VARCHAR(1000), entry VARCHAR(5000), author VARCHAR(50), email VARCHAR(100), date TIMESTAMP )"; if ($db->exec($sql)) { echo "Table created.<br />"; } else { echo "Error!"; } } catch (Exception ...
Read now
Unlock full access