I have been struggling with this piece of code all morning and can't figure out why it won't output the result of the SQL
$sql = "SELECT MAX(PartID) FROM `fullstocklist`";
$result=mysql_query($sql);
if(!$result){echo "<p>SQL Error</p>";exit;}
$row = mysql_fetch_row($result) or die(mysql_error());
echo "Maximum value is : ".$row['PartID'];
$checktop = $row['PartID'];
The query works, and returns the correct result in terminal, but I don't get an output after echo "Maximum value is :". The error must be in my php somewhere. Can anyone else spot it? It's really frustrating me