Error with PDO Fetch()

Hello friends,

I’m trying to retrieve some entries from a database. Unfortunately, I’m getting this error:
“Fatal error: Call to a member function fetch() on a non-object in C:\Wamp\www\projectpostup\ on line 82”

This is my script. I’m using PDO to access the MySQL db. “ERROR LINE” represents line 82, the one reporting the error.

		$db = new PDO(DB_INFO, DB_USER, DB_PASS);

		$sql = "SELECT entries FROM entrylist ORDER BY created DESC";
		$stmt = $db->query($sql);
ERROR LINE	$result = $stmt->fetch(PDO::FETCH_NUM);

		$db = null;

Any help? I’m just getting my feet wet with PHP and I enjoy it so far… I just can’t get this stupid thing to work.

You are using PDO incorrectly: