My question today is that I'm trying to return an id after I inserted a new line into my DB.
$sql = ('INSERT INTO `tSections`(`sSection`, `pCity_id`) VALUES (:sSection, :pCity_id) RETURNING pSection_id');
$new_section = $DBH->prepare($sql);
Without the returning pSection_id it works fine. Any ideas or solution. I'm assuming that I just forgot something simple.
Hope to hear from you guys soon.
This is the error that it gives
Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'RETURNING pJob_Type_id' at line 1' in