Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class MyDB extends SQLite3
- {
- function __construct()
- {
- $this->open('pathtodatabase');
- }
- }
- $db = new MyDB();
- if(!$db){
- echo $db->lastErrorMsg();
- } else {
- echo "Opened database successfully\n";
- }
- $sql =<<<EOF
- INSERT INTO test_table (Name,AGE,location,description)
- VALUES ('Joe Smith', '29', 'New York', 'IT Technician');
- EOF;
- $ret = $db->exec($sql);
- if(!$ret){
- echo $db->lastErrorMsg();
- } else {
- echo "Records created successfully\n";
- }
- $db->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement