prepare("SELECT * FROM users WHERE id = :i"); $userhash->bindParam(":i", $userID, PDO::PARAM_INT); $userhash->execute(); $userhash = $userhash->fetch(PDO::FETCH_OBJ); $userhash = $userhash->HeadshotThumbHash; // ... //construct the path $path = $GLOBALS['renderCDNPath'] . $userhash; // ... show_image($path, $width, $height); //exit; }