Find path dir from mysql in php -
i saving file paths in database this
id | file_path ------------------------------------------------------------ 1 home/games/ps3/cod.png 2 home/err.png 3 home/games/ps3logo.png 4 home/games/xboxlogo.png 5 home/games/pclogo.png 6 home/games/wiilogo.png 7 home/msg.png
i trying use php search files , files dir selected
$folder_path = "home/games/ps3";
i want show images in ps3 folder?
try using regex so:
$query = "select * files file_path rlike '^".$folder_path."/[^/]*\$'";
the query should like:
select * files file_path rlike '^home/games/ps3/[^/]*$'
Comments
Post a Comment