Code:
// Get parameters from url query string
$db = new dbPDO();
$cruiseportcam_id = !empty($_GET['id'])?intval($_GET['id']):1;
// get all the values form your table limited to the first matching row (there should only be one)
$query = "SELECT * FROM cruiseportcams WHERE cruiseportcam_id = $portcamid";
// the prepare and bind methods prevent any sort of SQL injection
$stmt = $db->prepare($query);
$stmt->bindValue("$portcamid",$cruiseportcam_id);
$stmt->execute();
// we are only expecting 1 row here...
$portcam = $stmt->fetch(PDO::FETCH_ASSOC);
// now $portcam is an array of the values from your database
$portcamtemplate = $portcam['cruiseportcam_template'];