2016-08-06 5 views

答えて

0
This will help you to save data in your custom table if you save table with wp prefix you can include that with table name. 
<?php global $wpdb; 
// for get user id 
$user_id = get_current_user_id(); 
$arrayinsert = array('user_id'=>$user_id,'Type_User'=>get_current_user_role()); ?> 
$insert_result = $wpdb->insert('my_users',$arrayinsert); 
if ($insert_result) { 
$varId = $wpdb->insert_id; 
} else { 
echo "Error:". $wpdb->last_query; 
} 
?> 
関連する問題