PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
//after u moved uploaded album, save it to db
if ($handle = opendir('testfile')) {
echo "Directory handle: $handle\n";
echo "Files:\n";
while (false !== ($file = readdir($handle))) {
$db = new database();
$db->newalbum($file);
echo "$file";
echo "<Br/>";
}
closedir($handle);
}
do you have any idea why there is periods inserted in the database?
foreach(glob('testfile/*.mp3') as $file) {
$db = new database();
$db->newalbum($file);
echo "$file";
echo "<Br/>";
}
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
oh i see its only going to get the files that are .MP3
this should work
edits.. so i can readdir in those conditions? or insert into database in those conditions, i don't care about the periods until its inserted in the database because heres what its doing.. if you can see them
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Glad you got it. The glob() would be so much easier, an shorter
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.