Hello! I'm constantly running in to these types of issues. I must be doing
something fundamentally wrong. I've instantiated a database connection like
so:
// ----------------------------------------------------------------------
$dsn = $config->dbadaptor . "://" // Build a DSN string (Data Source
Name)
. $config->username . ":" // Required by DB::connect()
. $config->password . "@"
. $config->host . "/"
. $config->dbname;
$db = DB::connect($dsn, TRUE);
if (DB::isError($db)) {
die($db->getMessage());
}
$this->db = $db;
// ----------------------------------------------------------------------
Later in my code, I do something like this:
// ----------------------------------------------------------------------
$sql = "INSERT INTO $table_name (" . implode(',',$transformed_keys) . ')
VALUES ( ' . implode(',',$values) . ' ) ';
$result = $this->db->query($sql);
$id = $this->db->lastInsertId();
// ----------------------------------------------------------------------
Unfortunately, I get the error, "undefined method DB_mssql::lastInsertId()".
What am I doing wrong?
Thanks!
- Bret
--
View this message in context:
http://www.nabble.com/undefined-method-DB_mssql%3A%3AlastInsertId%28%29----tf4853199s16154.html#a13887470
Sent from the Zend Framework mailing list archive at Nabble.com.