An error har occured.
', $e->getMessage(), '
'; } // Example of setting data $realHash = md5($_GET['name'] . $_GET['score'] . $secretKey); if ($realHash == $hash) { $sth = $dbh->prepare('INSERT INTO scores VALUES (null, :name, :score)'); try { $sth->execute($_GET); } catch (Exception $e) { echo '

An error has ocurred.

', $e->getMessage(), '
'; } } // Example of getting data $sth = $dbh->query('SELECT * FROM scores ORDER BY score DESC LIMIT 5'); $sth->setFetchMode(PDO::FETCH_ASSOC); $result = $sth->fetchAll(); if (count($result) > 0) { foreach ($result as $r) { echo $r['name'], "\t", $r['score'], "\n"; } }