Well this has me stumped. I've written a php script but for some reason get no output on my screen when I navigate to the page in my browser.
Have any of you mre savvy PHP users got any idea where I'm going wrong?
PHP Code:
<?php
/* Default values
---------------------------------------*/
$host = "localhost";
$dbms = "mysql";
$database = *my_database_name*;
$username = *my_user*;
$password = *password*;
/* Creating the DSN (Data Source Name)
----------------------------------------*/
$dsn = "$dbms:host=$host;dbname=$database";
/* Connecting via PDO
----------------------------------------*/
try{
$dbh = new PDO ($dsn, $username, $password);
$statement = $dbh->prepare("SELECT * FROM sort WHERE sort_id =144 ");
$result = $statement->fetchObject();
echo $result->movie_title;
}catch(PDOException $e) {
echo $e-> getMessage();
}
?>
Have any of you mre savvy PHP users got any idea where I'm going wrong?