EDIT: I am using PDO object, not MYSQLI nor am I trying to get lastId, these are not the same questions that you're marking 'duplicate' they are just different solutions.
I am having an issue with my SQL statement that I am using a PDO object for and I keep getting this error (below), I have tried several things and done some research, but I could not find anything to work. Any info on what I am doing wrong (Or if this is an illegal statement).
Thanks for any help!
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 'INSERTED.*
INTO `visits` (`cardNum`, `purpose`, `status`) VALUES ('0','0','0') at line 1
Statement
$pdo->prepare('INSERT INTO `visits` (`cardNum`, `purpose`, `status`) OUTPUT INSERTED.* VALUES (?,?,?)');