View Single Post
  #24 (permalink)  
Old 02-08-2008, 09:37 PM
Falcon Falcon is offline
D-Web Analyst
 
Join Date: Nov 2007
Location: Chennai
Posts: 289
Falcon is on a distinguished road
Default Re: Joomla introduction?

Quote:
Originally Posted by npugila1983 View Post
hi

I want to insert a record in member table and after that i want insert record in the members roles table for the current user.

After inserting into the member table i need the member id of the last inserted user. Then only i can able toinsert record into the role table.

I am using the store() function to insert this both.

How can i get the member id. ie, last insert_id
Hi Pugal

At first you have to insert data to the first table using store funtion then you can bind the second class using the variable used in the first class for example

$oRow=mosUser($database);
$oRow->id='';
$oRow->username=$_request['user'];
$oRow->password=$_request['user'];
$oRow->store();

$oRowProfile=mosUserProfile($database);
$oRowProfile->id='';
$oRowProfile->userid=$oRow->id;
$oRowProfile->name=$_request['name'];
$oRowProfile->Store();

I think its helpful for you

Regards
Falcon
Reply With Quote