Added file useful for grading

This commit is contained in:
Paul committed 2014-06-11 14:29:03 +02:00
1 parent 9468cb2518
commit 8da91538e2
1 file changed
+17
+17
View File
@@ -0,0 +1,17 @@
<?php
$connection = new mysqli('localhost', 'bank', 'pass', 'bank');
$result = $connection->query("SELECT * FROM gebruikers WHERE gebruikersnaam = 'Bob'");
$row = $result->fetch_array();
echo "Bob heeft: " . $row['balans'] . "<br>";
if ((int)$row['balans'] >= 1000000) {
echo "Bob is miljonair<br>";
}
echo "Updating back to 10.00<br>";
$connection->query("UPDATE gebruikers SET balans = 10.00 WHERE gebruikersnaam = 'Bob'");
$connection->close();
?>