diff options
| author | root | 2014-02-25 19:19:52 +0100 |
|---|---|---|
| committer | root | 2014-02-25 19:19:52 +0100 |
| commit | f254f1553d06953083c66620c6257682355064d1 (patch) | |
| tree | b3d36595f1a72e67dbbadce23151b7844a728f36 /www | |
| parent | 8f54d6bfe9c35cae2efe8d1850b02c51e3cae69d (diff) | |
| download | random-f254f1553d06953083c66620c6257682355064d1.tar.gz | |
database transfer complete
Diffstat (limited to 'www')
| -rw-r--r-- | www/insertfile.php | 8 | ||||
| -rw-r--r-- | www/setup.php | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/www/insertfile.php b/www/insertfile.php index 5e07130..8053eb5 100644 --- a/www/insertfile.php +++ b/www/insertfile.php @@ -7,19 +7,25 @@ $bool = false; $db = new SQLite3("../database/dict.db"); + if($file = file($dic)){ $rows = count($file); for($i=0;$i<$rows;$i++){ + + $file[$i] = preg_replace("/\/(.*)$/", "", $file[$i]); +// echo "#" . $i . ": " . $file[$i] . "<br>"; + if(!$db->exec(" BEGIN TRANSACTION; - INSERT INTO " . $table " VALUES (NULL, " . $file[$i] . "); + INSERT INTO " . $table . " VALUES (NULL, \"" . $file[$i] . "\"); COMMIT; ")){ echo "Failure writing to the database at row" . $i ."!"; $bool = true; break; } + } if(!$bool){ diff --git a/www/setup.php b/www/setup.php index a4ab123..9158353 100644 --- a/www/setup.php +++ b/www/setup.php @@ -1,6 +1,7 @@ <? $db = new SQLite3("../database/dict.db"); +$bool = false; foreach ($_GET as $name => $value) { if(preg_match("/drop(ped)?/i",$name)){ |
