Setup entering the file into the database.
This commit is contained in:
parent
c0558284b5
commit
67a25185c7
1 changed files with 11 additions and 0 deletions
11
import.php
11
import.php
|
@ -1,5 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$config = json_decode(file_get_contents('nca.conf'));
|
||||||
|
$db = mysqli_init();
|
||||||
|
|
||||||
|
$db->real_connect($conf->hostname,$conf->username,$conf->password,
|
||||||
|
$conf->database);
|
||||||
|
|
||||||
$upload_dir = '/home/ncaguild/nca-guild.com/screens/uploads/';
|
$upload_dir = '/home/ncaguild/nca-guild.com/screens/uploads/';
|
||||||
$uploads = scandir($upload_dir);
|
$uploads = scandir($upload_dir);
|
||||||
|
|
||||||
|
@ -45,6 +51,11 @@ foreach($uploads as $upload) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$query = $db->prepare("INSERT INTO uploads (id,extension,original_name,width,height,size,hash) VALUES(?,?,?.?.?.?)");
|
||||||
|
$query->bind_param('isssiids',$id, $extension, 'unknown', $width, $height, $size, $hash);
|
||||||
|
$query->execute();
|
||||||
|
$query->close();
|
||||||
|
|
||||||
$current['height'] = $height;
|
$current['height'] = $height;
|
||||||
$current['width'] = $width;
|
$current['width'] = $width;
|
||||||
$current['file_size'] = $file_size;
|
$current['file_size'] = $file_size;
|
||||||
|
|
Loading…
Reference in a new issue