I am running this from the command line using php 5.3.5 on windows XP using php installed with wamp.
I can read the data in the created database using a text editor.
Can anyone explain why the SQLite DB created is not encrypted. openssl and mcrypt are both installed and show as enabled in phpinfo().
function createTables($db){
$account = "Create table if not exists account ("
."id integer primary key autoincrement"
.", name varchar(20)"
.", address varchar(50)"
." )";
$payment = "Create table if not exists payment ("
."id integer primary key autoincrement"
.", accountID integer references account(id)"
.", amount float"
." )";
$db->exec($account);
$db->exec($payment);
}
/*
* main line code
*/
$db = new SQLite3("testDB", SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE, "myEncryptKey" );
if ( $db === false ){
echo "Can not open Transaction Database.";
exit;
}
createTables($db);
$sql = "insert into account values (null, 'john welch', '110 S main, wichita ks')";
$db->exec( $sql);
$sql = "";
$sql = "insert into payment values (null, ".$db->lastInsertRowID().", 23.45)";
$db->exec($sql);
$db->close();