Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $Database_Server = "";
- $Database_Name = "";
- $Database_Username = "";
- $Database_Password = "";
- $Database_Status = false;
- try
- {
- $Database_Connection = new PDO("mysql:host=$Database_Server;dbname=$Database_Name;", $Database_Username, $Database_Password);
- $Database_Connection -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $Database_Status = true;
- }
- catch(exception $e)
- {
- print("Unable to connect" . $e -> getMessage());
- }
- if($Database_Status)
- {
- $CustomerName = $_GET["CustomerName"];
- $Movie = $_GET["Movie"];
- $FindMovie = $Database_Connection -> prepare("SELECT * FROM MovieSystem_Purchases WHERE Username = :CustomerName AND Movie_Name = :Movie");
- $FindMovie -> bindParam(':CustomerName', $CustomerName, PDO::PARAM_STR);
- $FindMovie -> bindParam(':Movie', $Movie, PDO::PARAM_STR);
- $FindMovie -> execute();
- $FindMovieResult = $FindMovie -> fetch(PDO::FETCH_ASSOC);
- $FindMovieUrl = $Database_Connection -> ("SELECT * FROM MovieSystem_Movies WHERE ID = :ID");
- $FindMovieUrl -> bindParam(':ID', $FindMovieResult['Movie_ID'], PDO::PARAM_STR);
- $FindMovieUrl -> execute();
- $FindMovieUrlResult = $FindMovieUrl -> fetch(PDO::FETCH_ASSOC);
- print($FindMovieUrlResult['URL']);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement