This is my PHP snippet:
$con = mysqli_connect('localhost','root','','db');
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}
mysqli_select_db($con,"db");
$sql = "UPDATE nations SET queue='MAX(queue) FROM nations' WHERE nation_name='$nation'";
$query = mysqli_query($con,$sql);
$result = mysqli_fetch_assoc($query);
The query should by my understanding get the current highest value from column queue
and then add 1 to that result, and insert that new value into the table. This is not working the way I want and it simply sets the queue to 0...