5
1
Fork 0
mirror of https://github.com/Anvilcraft/jensmemes synced 2024-11-14 14:01:55 +01:00

Added SQLImporter

This commit is contained in:
ITbyHF 2020-07-25 11:36:45 +02:00
parent 5405ec9b1f
commit d8a5108299

33
website/sqlimporter.php Normal file
View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>SQL Script</title>
</head>
<body>
<h1>SQL importer</h1>
<form method="post" action="#">
<input type="submit" name="submit" value="Start">
</form>
<?php
if(isset($_POST['submit'])){
include('dbcon.php');
$files = glob('images/*/*', GLOB_BRACE);
foreach ($files as $file) {
$stmt = "INSERT INTO images(user,path, cat) VALUES ('System', '$file', 'jens')";
$result = mysqli_query($con, $stmt);
if($result){
echo "<b>IMG STORED: </b>".$file.'<br>';
}
}
}
?>
</body>
</html>