query($sql); } /** * List tables for the current database * * @return mixed */ function get_tables() { //TODO: implement } } class SQLite_manip extends SQLite { function __construct($dsn) { parent::__construct($dsn); } /** * Convenience function to create a new table * * @param string $name //Name of the table * @param array $columns //columns as straight array and/or column => type pairs * @param array $constraints // column => constraint pairs * @param array $indexes // column => index pairs * @return srtring */ function create_table($name, $columns, $constraints, $indexes) { $sql = "CREATE TABLE {$name} ("; foreach($columns as $colname => $type) { if(is_numeric($colname)) { $colname = $type; } } } /** * Create an sqlite database file * * @param $path */ function create_db($path) { // Create the file if it doesn't exist if( ! file_exists($path)) { touch($path); } } }