1
0
www.mikescher.com/demos/blog/protected/data/dbgen.php

14 lines
260 B
PHP
Raw Normal View History

2014-05-12 10:11:20 +02:00
<?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);
}