diff --git a/lab-5/vending-machine/index.php b/lab-5/vending-machine/index.php index 843df659d7e20df84bdcaac2d15afda3d92b62d8..bcdc3a6eaf0d6612e0e995710d543abb68cd3e7c 100755 --- a/lab-5/vending-machine/index.php +++ b/lab-5/vending-machine/index.php @@ -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> £".$row['price']."</td> </tr>";