Get current user ID then post into separate database
-
I’ve looked and looked and can’t quite find the answer to what I’m looking to do.
I’ve looked at the Codex and found the PHP code to collect the current user id. However there’s a warning, so I wanted to ask the community if it’s possible and direction on how to complete this.
So here’s the situation: I have an application written in PHP and MySQL that’s separate of WP. What I’m wanting to do is collect the logged in users ID, post it to the database for this app. And then join those two later when the user calls their postings.
Here’s how the process looks: User logs in, navigates to form, when form is submitted; form collects and posts the current users ID into a userid field in the database.
Later I will add: join of database, select from tbl where userid=’userid’.
The user must be logged in in order to view the form. My file structure is in the sites root directory.
The topic ‘Get current user ID then post into separate database’ is closed to new replies.