From 4baee1f0a462bf9d3a7210f4c1ca44ca9c705da9 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Tue, 25 Feb 2014 18:57:34 +0100 Subject: database setup --- www/insertfile.php | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'www/insertfile.php') diff --git a/www/insertfile.php b/www/insertfile.php index cfc52a7..5e07130 100644 --- a/www/insertfile.php +++ b/www/insertfile.php @@ -1,10 +1,31 @@ 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."; + } -if($file = file($en_dic)){ - echo "Inserted file"; } else { echo "No file found!"; } -- cgit v1.2.3