[solved] Help with using mysql_insert_id

This is a discussion on "[solved] Help with using mysql_insert_id" within the PHP Forum section. This forum, and the thread "[solved] Help with using mysql_insert_id are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 8th, 2008, 19:03
New Member
Join Date: Mar 2008
Location: UK
Age: 29
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Cool [solved] Help with using mysql_insert_id

Hi all

I'm building a web application for a client, and I'm a little stuck on using the "mysql_insert_id" function.

Basically, once a member registers, their profile information is inserted into the central database, which is not a problem - done this hundreds of times before.

The problem is that the client wants the members to be emailed their account login information, as soon as registration is complete.

I'm using Dreamweaver 8, so how would I go about getting the unique id of the last inserted ID so that I can create a recordset, based on this?

Hope I've made myself clear enough, please feel free to email me for further clarification!

Many thanks

John Alexander Hopper

Last edited by Jack Franklin; Mar 8th, 2008 at 20:46. Reason: Removed email from post.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 8th, 2008, 20:42
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,267
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Help with using mysql_insert_id

I've had the exact same problem. You can either set the id to auto_increment, (The easiest way) or you can use a query like this:

Code: Select all
SELECT `id` FROM `my_table` ORDER BY `id` ASC LIMIT 0,1
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 8th, 2008, 22:16
New Member
Join Date: Mar 2008
Location: UK
Age: 29
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with using mysql_insert_id

Hi

Thankyou very much for that - it's sorted my problem!

John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 1 solved problem causes another delusion Web Page Design 9 Dec 21st, 2007 08:12
Adding "Topic Solved" for solved topics AdRock Webforumz Suggestions and Feedback 21 Oct 4th, 2007 15:08


All times are GMT. The time now is 02:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42