This option does not work. var_dump($max)
returns NULL.
if ($result = $this->mysqli->prepare("SELECT MAX(`id`) FROM `table1` WHERE `testrow1`=? OR `testrow2`=? OR `testrow3`=? OR `testrow4`=?")) { $result->bind_param("iiii", $usid, $usid, $usid, $usid); $result->execute(); $result->bind_result($max); $result->close(); }