Add new SQL record, then retrieve that record's index, for further update, in PHP

Posted on 2013-05-28
Last Modified: 2013-05-28

I have a table in a SQL Express database which has an incrementing index field.
What I need to do is to add a new record, but get that record's unique incremented index so that I can display this number, then write subsequent updates to the same record. I need to make sure the 'last record added' that the information comes from is for the particular user and not just the last record on the database, as this may be different - for example if multiple users are adding multiple records at around the same time.

I am using PHP with MS SQL Express 2008.

How would I achieve this?

Question by:davidcowler
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Ross Turner earned 200 total points
ID: 39201340

Expert Comment

by:Ross Turner
ID: 39201388
Have a look at this!3/af151/3

Author Closing Comment

ID: 39201590
Super :)

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor ( Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question