enter image description here

when i register for free sign up on membermouse.data is entered into wordpress table and membermouse table .

My question:

how can we get last inserted id from wordpress user table in membermouse free sign up page .???

or

how can we copy last member details inserted into wordpress user table to my own table (with php or mysql queries automatically).??

database screenshots:

wordpress table(entries with membermouse)

my table
enter image description here

Code :

my custom sign up code doesn’t work under $req=$orderRequest->submitRequest();,so i put above. .i also know both queries are working on same time,thats why i’m unable to get lastinserted id .

<?php 
//my custom sign up code to insert entry into my own table.
 require_once('../../../../wp-config.php'); 
$email=$_POST['email'] ;   
$pass=$_POST['password'];     
global  $wpdb;  
 $randomFact = $wpdb->get_results( "SELECT ID FROM lwy_users where user_email='".$email."'");
$memid=$randomFact[0]->ID;  //this  $memid is null ..i want value of  $memid
   if( email_exists( $email )) 
  {  
   }                   
   else    
   {           
$wpdb->query("insert into mm_members (MemberID,MemberUserEmail ,MemberPassword,MemberClass) VALUES ('".$memid."','".$email."','".$pass."','B') "  );
   }  
//membermouse sign up code
require_once("../../../../wp-load.php");
require_once("../includes/mm-constants.php");
require_once("../includes/init.php");
$orderRequest = new MM_FreeMemberWebformRequest($_POST);
$req=$orderRequest->submitRequest();
?>

Read more here: Get last inserted id in sign up page in membermouse plugin?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: