Marrvel Posted September 20, 2005 Share Posted September 20, 2005 Does anyone know if theres is an equivalent to the mysql_insert_id() function in mssql or am i going to have to run another query to get the last insert id? Quote Link to comment https://forums.phpfreaks.com/topic/2543-mysql-function-equivalent/ Share on other sites More sharing options...
micah1701 Posted September 20, 2005 Share Posted September 20, 2005 mssql_bind -- Adds a parameter to a stored procedure or a remote stored procedure mssql_close -- Close MS SQL Server connection mssql_connect -- Open MS SQL server connection mssql_data_seek -- Moves internal row pointer mssql_execute -- Executes a stored procedure on a MS SQL server database mssql_fetch_array -- Fetch a result row as an associative array, a numeric array, or both mssql_fetch_assoc -- Returns an associative array of the current row in the result set specified by result_id mssql_fetch_batch -- Returns the next batch of records mssql_fetch_field -- Get field information mssql_fetch_object -- Fetch row as object mssql_fetch_row -- Get row as enumerated array mssql_field_length -- Get the length of a field mssql_field_name -- Get the name of a field mssql_field_seek -- Seeks to the specified field offset mssql_field_type -- Gets the type of a field mssql_free_result -- Free result memory mssql_free_statement -- Free statement memory mssql_get_last_message -- Returns the last message from the server mssql_guid_string -- Converts a 16 byte binary GUID to a string mssql_init -- Initializes a stored procedure or a remote stored procedure mssql_min_error_severity -- Sets the lower error severity mssql_min_message_severity -- Sets the lower message severity mssql_next_result -- Move the internal result pointer to the next result mssql_num_fields -- Gets the number of fields in result mssql_num_rows -- Gets the number of rows in result mssql_pconnect -- Open persistent MS SQL connection mssql_query -- Send MS SQL query mssql_result -- Get result data mssql_rows_affected -- Returns the number of records affected by the query mssql_select_db -- Select MS SQL database I don't see it. Sorry. But what's wrong with doing a "SELECT MAX(id) FROM table" Query? Quote Link to comment https://forums.phpfreaks.com/topic/2543-mysql-function-equivalent/#findComment-8433 Share on other sites More sharing options...
Marrvel Posted September 20, 2005 Author Share Posted September 20, 2005 Thanks for that, no problem running another query, just wondered if there was an alternate function Quote Link to comment https://forums.phpfreaks.com/topic/2543-mysql-function-equivalent/#findComment-8435 Share on other sites More sharing options...
raul Posted February 24, 2006 Share Posted February 24, 2006 [!--quoteo(post=297379:date=Sep 20 2005, 06:29 PM:name=Marrvel)--][div class=\'quotetop\']QUOTE(Marrvel @ Sep 20 2005, 06:29 PM) 297379[/snapback][/div][div class=\'quotemain\'][!--quotec--] Does anyone know if theres is an equivalent to the mysql_insert_id() function in mssql or am i going to have to run another query to get the last insert id? Yes! SELECT SCOPE_IDENTITY() AS LastInsertedID; U could also take a loot at [a href=\"http://ionescuraul.users.phpclasses.org/browse/package/2832.html\" target=\"_blank\"]http://ionescuraul.users.phpclasses.org/br...ckage/2832.html[/a] ! Quote Link to comment https://forums.phpfreaks.com/topic/2543-mysql-function-equivalent/#findComment-12335 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.