14 lines
260 B
PHP
14 lines
260 B
PHP
|
<?php
|
||
|
|
||
|
$dbFile=dirname(__FILE__).'/blog.db';
|
||
|
$sqlFile=dirname(__FILE__).'/schema.sqlite.sql';
|
||
|
|
||
|
@unlink($dbFile);
|
||
|
$db=new PDO('sqlite:'.$dbFile);
|
||
|
$sqls=file_get_contents($sqlFile);
|
||
|
foreach(explode(';',$sqls) as $sql)
|
||
|
{
|
||
|
if(trim($sql)!=='')
|
||
|
$db->exec($sql);
|
||
|
}
|