lastId() public static method

Method that returns the ID of the last inserted row or sequence value Database such as MS SQL Server, PostgreSQL, among others, they make use variable sequence
public static lastId ( string $sequence = null ) : array
$sequence string Name of the variable sequence requested for some database
return array
示例#1
0
 /**
  * Format the Result
  * 
  */
 private function getResult($result, $show_lastid = false)
 {
     $result = '<br /><br /> - The code above will output: <pre style="color:blue;">' . print_r($this->sanitize($result), true) . '</pre>';
     $result .= 'Total records affected: <strong style="color:red;">' . PDO4You::rowCount() . '</strong>';
     $result .= $show_lastid ? '&nbsp;&nbsp; Id of the last iteration: <strong style="color:red;">' . PDO4You::lastId() . '</strong>' : null;
     return $result;
 }