I've got a page that is passed a variable by the URL (video.php?video=VALUE) which is then used throughout the page to pull in various details about the video - title, a still, year etc.
I want to display a 404/error if an incorrect value or something not in the database is entered into the URL string, and display the page with corresponding values pulled from the database if the value is correct
At present I'm just trying to get the basic code down and have written the following...
<?php include("credentials.inc"); ?>
<?php
$video = $_GET['video'];
$videodata = $pdo->prepare("SELECT * FROM video WHERE site url =:siteurl LIMIT 1"); // check db for :siteurl value
$videodata->bindParam(':siteurl', $_GET['video'], PDO::PARAM_STR); // bind site url to $_Get Value...
$videodata->execute(); // execute
if($videodata->rowCount()) { // If videodata [url string] returns data then...
echo '<b>hello world... this entry is there!</b>';
} else {
echo 'NO .... ITS NOT THERE';
}
?>
I don't seem to be getting any errors, but at the same time nothing is happening and the page I'm getting back is simply blank.
Any pointers as to where am I going wrong with my code would be massively appreciated!