Thursday, May 10, 2012

Insert data in wordpress table

$wpdb->insert('wp_profile_visitor', array(
            'profile_id' => $final_curauth->ID,
            'visitor_id' => $final_current_user->ID,
            'visitor_name' => $final_current_user->display_name,
            'visitor_nicename' => $final_current_user->user_nicename,           
            ) );
"wp_profile_visitor" is table name
"profile_id" is table field name and $final_curauth->ID is dynamic data..

You can also insert in  another format. I have given a example please see  http://h20bikash.blogspot.com/2012/05/inserting-into-data-in-wordpress.html


No comments:

Post a Comment