<?php
require_once 'login.php';
$conn = new mysqli($hn, $un, $pw, $db); //these three lines connect to the db with the login file
if($conn->connect_error) die($conn->connect_error); //all the lines above here will be in all your codes
$query = "SELECT * FROM orders"; //the query
$result = $conn->query($query); //run the query and get the result
if(!$result) die($conn->error);
$rows = $result->num_rows;
$query = "SELECT max(orderid) from orders";
$result = mysqli_query($conn, $query);
while($row = mysqli_fetch_assoc($result)){
echo "{$row(orderid)'}";
}
?>
I keep getting an error
( ! ) Notice: Undefined index: MAX(orderid) in C:\wamp64\www\groupproject\test1.php on line 23
Whats causing this?