diff options
| author | root | 2014-02-26 16:25:49 +0100 |
|---|---|---|
| committer | root | 2014-02-26 16:25:49 +0100 |
| commit | e2dfb7fd3f5da5fac7788ed8bcb146b29d87a8c2 (patch) | |
| tree | a703653b90f1a1522cce4134a1aa5871eb32747d /www/insertfile.php | |
| parent | e9545de88cc1021d2b5f2a616bc9c472e65781e7 (diff) | |
| download | random-e2dfb7fd3f5da5fac7788ed8bcb146b29d87a8c2.tar.gz | |
mv
Diffstat (limited to 'www/insertfile.php')
| -rw-r--r-- | www/insertfile.php | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/www/insertfile.php b/www/insertfile.php deleted file mode 100644 index 8053eb5..0000000 --- a/www/insertfile.php +++ /dev/null @@ -1,37 +0,0 @@ -<? - -$dic = "../blob/en_GB.dic"; -$table = "english"; - -$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] . "\"); - COMMIT; - ")){ - echo "Failure writing to the database at row" . $i ."!"; - $bool = true; - break; - } - - } - - if(!$bool){ - echo "Successfull transfered the file into the database."; - } - -} else { - echo "No file found!"; -} |
