You can do that by using the scandir php function:
A simple code:
$dir = ‘images’;
$extract = scandir($dir);
To show the results, use:
How to turn print_r($extract); into a variable?
foreach($extract as $file)
$file will be the variable.
After this, you can copy paste your results into an excel file and save the file as .csv.
You can import the .csv file into phpmyadmin.
If you have any questions, leave in the comments.