note 49094 deleted from ref.sqlite by cmb
| From: | cmb@php.net | Date: | Mon, 02 Nov 2020 14:56:46 +0000 |
| Subject: | note 49094 deleted from ref.sqlite by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215702@lists.php.net to get a copy of this message | ||
Note Submitter: hunreal+php at gmail dot com
----
Check the db/table if exist
$db_name='db';
$db=new SQLiteDatabase($db_name, 0666, $error);
if ($error) exit($error);
$q=$db->query("PRAGMA table_info(test)");
if ($q->numRows()!=2) {
if (!@$db->queryexec("
CREATE TABLE test (
id INTEGER NOT NULL PRIMARY KEY,
text VARCHAR ( 255 ) NOT NULL
)")
) exit ("Create SQLite Database Error\n");
}