[wp-hackers] Creating / Inserting into Table named after WP Username
William P. Davis
will.davis at gmail.com
Sun Aug 25 03:19:34 UTC 2013
Can you explain what you're trying to do here? We might be able to find a method that doesn't need to create a table for each user, which would get around this problem entirely.
Sent from my BlackBerry
From: Ryan McCue <lists at rotorised.com>
Sender: "wp-hackers" <wp-hackers-bounces at lists.automattic.com>Date: Sun, 25 Aug 2013 11:42:07
To: <wp-hackers at lists.automattic.com>
Reply-To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Creating / Inserting into Table named after WP
> This isnt working, I need to grab the active logged in user via Sql but I am
> unsure how.
I'm not quite sure what you're trying to do here, but you can't get the
current user via SQL, it's set via cookies.
If you're doing this in a plugin/theme, then please don't use raw SQL
queries for this. The global $current_user contains all the data you'll
need, and if you need to store custom data for the user, please use user
meta instead of custom tables.
If you're doing this in some separate application, you need to load WP
in and use the authentication functions to get at the data.
More information would be helpful so that we know what you're trying to do.
wp-hackers mailing list
wp-hackers at lists.automattic.com
More information about the wp-hackers