php-db | 2002091
Date: 09/02/02
- Next message: andy: "[PHP-DB] gettin records from today, yesterday, etc."
- Previous message: :B nerdy: "[PHP-DB] noobie db: oracle?"
- Next in thread: Heiko Mundle: "[PHP-DB] Re: mssql: insert a record and return the auto increment ID"
- Reply: Heiko Mundle: "[PHP-DB] Re: mssql: insert a record and return the auto increment ID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I insert a new record with PHP into my MS SQL Server database.
The key is defined with
auto_id INT IDENTITY(1000,1) NOT NULL,
how do I get the new id to use it in PHP?
To insert the record I use this code:
$sSql = "INSERT INTO myTable (time_in ) VALUES ( getdate() )";
$pResult = mssql_query($sSql, $g_pDBServer);
Thanks a lot for your help
Heiko
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: andy: "[PHP-DB] gettin records from today, yesterday, etc."
- Previous message: :B nerdy: "[PHP-DB] noobie db: oracle?"
- Next in thread: Heiko Mundle: "[PHP-DB] Re: mssql: insert a record and return the auto increment ID"
- Reply: Heiko Mundle: "[PHP-DB] Re: mssql: insert a record and return the auto increment ID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

