Commit def419ea authored by Sorrel Harriet's avatar Sorrel Harriet
Browse files

updating vending machine without my db deets

parent 38dc044f
......@@ -4,9 +4,9 @@
// define a connection 'handle'
$link = mysqli_connect(
'localhost',
'sharr003',
'password123',
'sharr003_vendingmachine'
'USERNAME',
'PASSWORD',
'DATABASE_NAME'
);
// check connection succeeded
......@@ -18,7 +18,7 @@ if (mysqli_connect_errno()) {
$content = "<h1>Hot Drinks Menu</h1>";
// define the SQL query to run
$sql = "SELECT name, code, price FROM DrinkOption ORDER BY code";
$sql = "SELECT drink_name, code, price FROM DrinkOption ORDER BY code";
// fetch records as a result-set
$result = mysqli_query($link, $sql);
......@@ -32,7 +32,7 @@ if ($result === false) {
// fetch associative array
while ($row = mysqli_fetch_assoc($result)) {
$content .= "<tr>
<td>".$row['name']."</td>
<td>".$row['drink_name']."</td>
<td>".$row['code']."</td>
<td> &pound;".$row['price']."</td>
</tr>";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment