PHP Code:
<?
 $sql = "SELECT * FROM bns_cars WHERE id =(".$_GET['id'].")";          
 $data = mysql_query( $sql ) 
 or die(mysql_error()); 
 while($info = mysql_fetch_assoc( $data )) 
 { 
 $bsql = "SELECT * FROM `bns_brands` WHERE `id` = {$info['brand']};"; 
 $bresult = mysql_query($bsql); 
while ($binfo = mysql_fetch_assoc($bresult)) { 
    echo "{$binfo['title_en']}</br>"; 
  }
  $csql = "SELECT * FROM `bns_cars_images` WHERE `record_id` = (".$_GET['id'].");"; 
 $cresult = mysql_query($csql); 
 $cinfo = mysql_fetch_array($cresult);
  echo "<img src=http://xxx.com/uploads/cars/{$cinfo['path']}/{$cinfo['file_name']} width=170px height=113px />" ; 
 } 
 ?>
So basically this is what i am using to get the path of my stored image and the file name but the problem here is that if the file name is saved as such "file_365_Untitled attachment 00124.jpg" then it will only parse out the "file_365_Untitled" from it and i want it to fetch the complete information not just the string before space.

Also if anyone can make this process short then it would be appreciated too