i have query in my php code
$dbc = mysqli_connect('localhost', 'root','', 'delivery')
or die('Error connecting to MySQL server.');
$count = "SELECT MAX(id_pelanggan) FROM pelanggan";
$result = mysqli_query($dbc, $count)
or die('Error select query');
if (empty($result)) {
$id_pelanggan = 1;
}
else {
$id_pelanggan = $result + 1;
}
and the result was
Object of class mysqli_result could not be converted to int in C:\xampp\htdocs\delivery\addcustomer.php
whereas in mysql id_pelanggan datatype is int. can anyone help me to make it works?