Try this: Add a new column "video_name varchar(30)" to your MySQL table and add some values like: smt.avi - then create the php file: <?php ... $sql ="select video_name from $table_name where ..." .... while ($row =mysql_fetch_array($result)) { $video_name = $row['video_name']; }...