*
* @access public
*
- * @param integer Result
- * @param string PostgreSQL sequence
+ * @param string Table name
+ * @param string Auto-up field
*
* @return integer Insert ID
*/
- function insert_id($result, $sequence)
+ function insert_id($table, $field)
{
- $temp = $this->query("SELECT currval($sequence) AS auto_inc");
- //$temp = call_user_func($this->commands['query'], "SELECT currval($table_col)");
- var_dump( $temp);
- print_r($this->fetch_array($temp));
+ $temp = $this->query_first("SELECT last_value FROM {$table}_{$field}_seq");
+ return $temp['last_value'];
}
}