On Thu, March 29, 2007 12:57 pm, Sady Marcos wrote:
>
> hey..
> I am not obtaining use the function pdo::lastInsertId() with sql
> My code:
>
> $db = new PDO("mssql:host=host;dbname=database","user","password");
> $sql = "INSERT INTO users(name,status) VALUES('username','1)";
Are you really mi
use scope_identity() if you're using MS SQL Server 2000 or newer.
scope_identity slects the last id within your current scope (The last record
you entered in your current session)
On 3/29/07, Sady Marcos <[EMAIL PROTECTED]> wrote:
hey..
I am not obtaining use the function pdo::lastInsertId()
hey..
I am not obtaining use the function pdo::lastInsertId() with sql
My code:
$db = new PDO("mssql:host=host;dbname=database","user","password");
$sql = "INSERT INTO users(name,status) VALUES('username','1)";
$db->query($sql);
$db->lastInsertId();
Error:
SQLSTATE[IM001]: Driver does not suppo
3 matches
Mail list logo