I am trying to get the UUID that had just been inserted.
This works in phpMyAdmin. But throws an error in PHP.
$insert = $conn->query("
SET @usr_uuid = uuidToBin(UUID());
INSERT INTO `users` (`users`.`usr_uuid`) VALUES ( @usr_uuid );
SELECT HEX(@usr_uuid) AS usr_uuid;
");
However I get this error:
[errno] => 1064
[sqlstate] => 42000
[error] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO `users` (`users`.`usr_uuid`) VALUES ( @u' at line 3
How do I go about fixing this?