So just as I began to get a good grasp on MySQL, I found out I should be learning about PDO. This is the (unfinished) code I have so far. I'd like to get it working before worrying about adding more password security. When I run the script, the printed message is "Array". How can I break this down and retrieve the data in the array?
try {
$db = new PDO($dbhost, $dbuser, $dbpassword);
$statement = $db->prepare("select * from users where email = :name");
$statement->execute(array(':name' => $username));
$result = $statement->fetch();
echo $result;}
catch(PDOException $e) {echo $e->getMessage();}
Sorry if this is a silly question; I've been searching for a while, but can not find any good examples what match what I'm doing, and I learn better from examples than long, wordy descriptions (such as the PHP manual).