Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. include('mysql.php');
  3. if ($handle = opendir('images')) {
  4. while (false !== ($file = readdir($handle))) {
  5. if($file!='.' && $file!='..') {
  6. $images[] = "('".$file."')";
  7. }
  8. }
  9. closedir($handle);
  10. }
  11. $query = "INSERT INTO images (filename) VALUES ".implode(',', $images)." ";
  12. if (!mysql_query($query)) {
  13. print mysql_error();
  14. }
  15. else {
  16. print "Изображение подтверждено!";
  17.  
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement