iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old March 8th, 2008, 03:03 PM   #1
New Member
 

Join Date: Mar 2008
Location: UK
Age: 30
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 John Alexander Hopper is on a distinguished road
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; March 8th, 2008 at 04:46 PM.. Reason: Removed email from post.
John Alexander Hopper is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 8th, 2008, 04:42 PM   #2
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 15
Posts: 1,346
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
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 `id` FROM `my_table` ORDER BY `id` ASC LIMIT 0,1
__________________
Theron Luhn
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 8th, 2008, 06:16 PM   #3
New Member
 

Join Date: Mar 2008
Location: UK
Age: 30
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 John Alexander Hopper is on a distinguished road
Re: Help with using mysql_insert_id

Hi

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

John
John Alexander Hopper is offline  
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

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 HTML, XHTML and CSS 9 December 21st, 2007 04:12 AM
Adding "Topic Solved" for solved topics AdRock WebForumz Suggestions 21 October 4th, 2007 11:08 AM


Search Engine Optimization by vBSEO 3.2.0 RC8