[wp-hackers] getting user_id in buddypress profile page

Eric Hendrix hendronix at gmail.com
Sun Oct 6 03:05:39 UTC 2013


Shouldn't you be using double quotes around your vars (associative array
syntax)?


On Sat, Oct 5, 2013 at 7:22 PM, BenderisGreat <greglancaster71 at gmail.com>wrote:

> This is likely very simple, but I am having an issue with it.
>
> I am using
>
> <?php
>         global $wpdb, $userdata, $current_user;
>         $current_user = wp_get_current_user();
>         $userid = $current_user->ID;
> ?>
>
>
> I can echo out $userid and it shows the correct user ID, but when I put it
> into the form submit;
>
> $wpdb->insert(wp_jo_plugin_options, array (
>                 'user_id' => $userid,
>                 'length'  => $_POST['length'],
>                 'girth'  => $_POST['girth'],
>                 'date'    => $_POST['date'],
>
> it just posts a 0 to the database.  Am I doing something wrong here?  It
> seems very straight forward, never had an issue with such a simple task.
> But trying to add this code to buddypress is a real hassle.
>
>
>
>
> --
> View this message in context:
> http://wordpress-hackers.1065353.n5.nabble.com/getting-user-id-in-buddypress-profile-page-tp42444.html
> Sent from the Wordpress Hackers mailing list archive at Nabble.com.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
*Eric A. Hendrix*
hendronix at gmail.com
(910) 644-8940

*"Non Timebo Mala"*


More information about the wp-hackers mailing list