I've finally understood how to put data from a mysql database into an array for displaying on a webpage.
But, I am playing with the OPENDIR() function and listing all files inside a directory.
My problem is INSERTing those listed filenames into a simple mysql table. It's killing me!
<?php
$handle = opendir('/var/www/html/');
while($file = readdir($handle)){
echo "$file" . '<br>';
}
?>
I can echo the list just fine now. But, I'm still learning how to take any given array and make it go into a database.
How does one INSERT the filenames into the database? I'm playing around with how to place the sql statement inside the while() loop.
thanks!