使用unixodbc在mssql中获取最后插入的id

时间:2016-07-05 11:29:13

标签: php sql-server pdo

我想连接到mssql服务器,所以我使用unixodbc和POD驱动程序。现在,当我执行插入查询时,我想要最后一个inserted_id,所以我使用了PDO函数 cameraApp brill$ ionic page about (node:2213) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. _ _ (_) (_) _ ___ _ __ _ ___ | |/ _ \| '_ \| |/ __| | | (_) | | | | | (__ |_|\___/|_| |_|_|\___| CLI v2.0.0-beta.32 Usage: ionic task args ======================= page is not a valid task Available tasks: (use --help or -h for more info) start .......... Starts a new Ionic project in the specified PATH serve .......... Start a local development server for app dev/testing generate ....... Generate pages and components platform ....... Add platform target for building an Ionic app run ............ Run an Ionic project on a connected device emulate ........ Emulate an Ionic project on a simulator or emulator build .......... Build (prepare + compile) an Ionic project for a given platform. plugin ......... Add a Cordova plugin resources ...... Automatically create icon and splash screen resources (beta) Put your images in the ./resources directory, named splash or icon. Accepted file types are .png, .ai, and .psd. Icons should be 192x192 px without rounded corners. Splashscreens should be 2208x2208 px, with the image centered in the middle. upload ......... Upload an app to your Ionic account share .......... Share an app with a client, co-worker, friend, or customer lib ............ Gets Ionic library version or updates the Ionic library io ............. Integrate your app with the ionic.io platform services (alpha) security ....... Store your app's credentials for the Ionic Platform (alpha) push ........... Upload APNS and GCM credentials to Ionic Push (alpha) package ........ Use Ionic Package to build your app (alpha) config ......... Set configuration variables for your ionic app (alpha) service ........ Add an Ionic service package and install any required plugins add ............ Add an Ion, bower component, or addon to the project remove ......... Remove an Ion, bower component, or addon from the project list ........... List Ions, bower components, or addons in the project info ........... List information about the users runtime environment help ........... Provides help for a certain command link ........... Sets your Ionic App ID for your project hooks .......... Manage your Ionic Cordova hooks state .......... Saves or restores state of your Ionic Application using the package.json file docs ........... Opens up the documentation for Ionic ECENMBRJJCC:cameraApp brill$ ,它给了我错误。

  

PHP致命错误:未捕获PDOException:SQLSTATE [IM001]:驱动程序不支持此功能:驱动程序不支持lastInsertId()。

谷歌搜索了几个小时我找到了使用的解决方案,lastInsertId(),这并没有帮助我,它给了我错误。

  

PHP致命错误:未捕获PDOException:SQLSTATE [HY000]:常规错误:0 [Microsoft] [SQL Server的ODBC驱动程序13]连接正忙于另一个命令的结果

任何人都可以帮我解决问题吗?我想获得最后插入的内容

我的PHP代码在linode服务器上,我的数据库是MSSQL。

这是我的插入功能。

SELECT SCOPE_IDENTITY() as id

这是我的$resultOFP=$objDaMS->ManupulateData("INSERT INTO Offline_Patient (doctorid,firstname,lastname,mobile1,email,createdon,hsbit,clinicid) VALUES (?,?,?,?,?,?,?,?) ", array($DocID,$User_on_detail[0]['firstname'],$User_on_detail[0]['lastname'], $User_on_detail[0]['mobile1'],$User_on_detail[0]['email'],date('Y-m-d H:i:s'),true,$AddId)); 功能。

ManupulateData()

认真需要帮助。

0 个答案:

没有答案