Dont know what I'm missing...need help!

Here's the code that I'm trying to use from this post..

Code:
<?php include('dbconnect.php');

$img_dir = '../images/ads/';
$img_thmb = '../images/ads/sml_';

$ad_photo = $row['ad_photo'];

//unlink function return bool so you can use it as conditon
if(@unlink($img_dir.$ad_photo) && @unlink($img_thmb.$ad_photo)){
...