I cannot see an answer to my question after hours of searching online.
Trying to obtain id of last updated row. This is my php script-
$con = mysqli_connect("localhost","DB_NAME","PWD");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_select_db($con,"DB") or die ("no database");
$result=mysqli_query($con,"SET @update_ID := 0;
UPDATE TABLE_234 SET PLAYERNAME = PETER, ID = (SELECT @update_ID := ID)
WHERE PLAYERNAME IS NULL
LIMIT 1;
SELECT @update_ID ");
if (!mysqli_query($con,$result))
{
die('Error: ' . mysqli_error($con));
}
echo $ID;
mysqli_close($con);
The error-
Warning: mysqli_query() [function.mysqli-query]: Empty query in… on line…
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near…
Thank you for your help.