Jump to content


How do I return the auto incremented ID for each row

  • Please log in to reply
1 reply to this topic

#1 frankivey

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 August 2006 - 03:57 AM

I am building a custom datagrid for a simple customer tracking system and would like to know how do I return the id (which is auto-incremented) for each row so that I may use it to reference the fields (customername, email, payment amount) from each row?

the table structure is as follows (id auto increment, customername, email, payment_amount)

how do I return the [id] for each row in order to reference other fields in the row?

#2 manmadareddy

  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 18 August 2006 - 05:10 AM

Use mysql_insert_id() function to get the id of latest inserted record.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users