update_user_option() Not quite working right.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

update_user_option() Not quite working right.

Mark Harwood-2
(This is kinda a follow up to my last email which i was having problem
with emails no displaying.)

Hey All,

Im in the process of writing a little Profile Plugin to allow for more
options to be attached to a registered user, but im having issuse
updating email and url of the user.

update_user_option() does not seem to want to update wp_user table as i
thought it would, instead it inserts the option in to wp_usermeta which
is fine, but the issuse is that WordPress falls over with user_email
being placed in wp_usermeta. It refuses to pull back the users email and
in the case of the URL it gets confused into which one to display and
update :(

Any ideas how we to just change the feilds in wp_user instead of having
update_user_option() add them into the wp_usermeta table?

The source for the plugin can be found at the below URL
http://pastecode.net/?action=viewpost&tag=650

Many Thanks
Mark 'Phunky' Harwood
Founder of EuroCSS.NET
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: update_user_option() Not quite working right.

Jamie Talbot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Harwood wrote:
> Any ideas how we to just change the feilds in wp_user instead of having
> update_user_option() add them into the wp_usermeta table?
>

There may be better solutions, but why not just update the database yourself with a direct database
call yourself?

Something like:

$wpdb->query("UPDATE $wpdb->users SET user_email = '$myemail' WHERE ID = $userid LIMIT 1")

(Untested!)

Jamie.

- --
http://jamietalbot.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD6cyFrovxfShShFARAnPxAKCTWCmyehxok27HvBBVBjCefI27rgCgkR2e
BDx8dIQ8+syp+RDO3zTsysE=
=ljDU
-----END PGP SIGNATURE-----
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: update_user_option() Not quite working right.

Mark Harwood-2
yeah i wanted to try and keep to as many WP functions as possible, but
it would seem that ive been unable to do so.

So ive just gone ahead with using $wpdb->query

Thanks tho

Jamie Talbot wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Mark Harwood wrote:
>  
>
>>Any ideas how we to just change the feilds in wp_user instead of having
>>update_user_option() add them into the wp_usermeta table?
>>
>>    
>>
>
>There may be better solutions, but why not just update the database yourself with a direct database
>call yourself?
>
>Something like:
>
>$wpdb->query("UPDATE $wpdb->users SET user_email = '$myemail' WHERE ID = $userid LIMIT 1")
>
>(Untested!)
>
>Jamie.
>
>- --
>http://jamietalbot.com
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.5 (MingW32)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
>iD8DBQFD6cyFrovxfShShFARAnPxAKCTWCmyehxok27HvBBVBjCefI27rgCgkR2e
>BDx8dIQ8+syp+RDO3zTsysE=
>=ljDU
>-----END PGP SIGNATURE-----
>_______________________________________________
>wp-hackers mailing list
>[hidden email]
>http://lists.automattic.com/mailman/listinfo/wp-hackers
>  
>

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...