mirror of
https://github.com/Anvilcraft/jensmemes
synced 2024-11-14 14:01:55 +01:00
Added SQLImporter
This commit is contained in:
parent
5405ec9b1f
commit
d8a5108299
1 changed files with 33 additions and 0 deletions
33
website/sqlimporter.php
Normal file
33
website/sqlimporter.php
Normal 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>
|
Loading…
Reference in a new issue