1
0
Fork 0

Setup entering the file into the database.

This commit is contained in:
Andrew Tomaka 2011-11-11 16:40:53 -05:00
parent c0558284b5
commit 67a25185c7

View file

@ -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;