Saturday, 15 September 2012

php - check directory for files not in mysql database -



php - check directory for files not in mysql database -

i have code checks if there filenames in database table "files" not in directory "video/test". have been trying edit code opposite i.e checks if there filenames in directory "video/test" not in database table "files". having problem switching content other side of clause. i'm getting mysql syntax errors. can help me out this

$filenames = scandir("video/test"); $sql = sprintf( 'select * files filename not in ("%s")', implode( '","', $filenames ) );

something this:

$filenames = scandir("video/test"); $files = implode(",", $filenames ); $sql = sprintf( "select * files filename not in (".$files.")" );

give seek ;)

saludos.

php mysql file

No comments:

Post a Comment