Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Plugin update first_name, last_name in wp_usermeta on activation


peterverkooijen
Participant

@peterverkooijen

When I do this:

$fullname = $wpdb->get_var("SELECT meta FROM $wpdb->signups");
echo $fullname;

I get the serialized content of the first meta field in wp_signups:

a:8:{s:7:"field_1";s:13:"Julius Caesar";s:18:"xprofile_field_ids";s:2:"1,";s:20:"avatar_image_resized";s:84:"/serverpath/wp-content/blogs.dir/1/files/avatars/0/caesar.jpg";s:21:"avatar_image_original";s:84:"/serverpath/wp-content/blogs.dir/1/files/avatars/0/caesar.jpg";s:6:"public";s:1:"1";s:7:"lang_id";i:1;s:8:"blogname";s:9:"theempire";s:10:"blog_title";s:16:"The Roman Empire";}

The function inserted this crap also into the wp_usermeta fields. Success! (Sort of…)

The bit of data I need is the fullname, the second bit, in this case ‘Julius Caesar’. I’d need the second bit of data from the user with the activation key.

How would I add that to the query?

I’ll first try this:

$fullname = $wpdb->get_var("SELECT meta FROM $wpdb->signups WHERE activation_key = %s", $key);
echo $fullname;

Nothing… :-(

I probably had to add $key as an argument. Trying again after some food…

Skip to toolbar