Please note: if you used SQL Mapper to create a row in your table, you can simply do
$object->id;
Example (using a table containing quotation marks):
$quote = new DB\SQL\Mapper($db, 'quotes');
if($_POST){
$quote->copyFrom('POST');
$quote->save();
die("new quote added with id:".$quote->id);
}
source
share