From f254f1553d06953083c66620c6257682355064d1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Feb 2014 19:19:52 +0100 Subject: database transfer complete --- www/insertfile.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'www/insertfile.php') 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] . "
"; + 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){ -- cgit v1.2.3