Ok, got this query (works fine, inserts an all...)
$db = Zend_Db_Table::getDefaultAdapter();
$data = array(
"comment_id" => new Zend_Db_Expr("nextval('comments_comment_id_seq')"),
"comment" => $comment,
"comment_level" => 1,
"is_active" => true,
"status" => 0,
"id" => $id,
"user_id" => $_SESSION['role']['user_id'],
"ts_create" => $created,
"ts_mod" => $created
);
$db->insert($this->_name, $data);
$newID = $db->lastInsertId();
I have even tried even
$newID = $db->insert($this->_name, $data);
And I can't get the ID's value. Its not mysql(i) so I think thats my first issue, as postgres doesn't appear to have an autoincriment in the way I am used to working with it atleast. So I am hoping someone here can help me out. Anyway to get the "comment_id" columns id, on a new inserted item? Cause right now I try lastInsertID and all I get is false or 1 which in either case is wrong.