I wanna create a script that grabs all the image names from a folder and make's sql's for them. SQL: So yeah it would replace imgsource with where the image is and then it would go on. How would I do this?
Here you go .. modify it a bit and add your SQL code ! <?php /* Change this path */ $dir = "images/"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo "$file <br>"; /* Add current image to db */ mysql_query("INSERT INTO images VALUES ('', '$file')"); } closedir($dh); } } ?> PHP: