Where is Ninja form data stored in the WordPress database?

I have a Ninja form with textbox fields for user_firstname, user_lastname,  and website. When someone submits the form, where does the data go in the WordPress database?  Suppose, for example, I want to know the website for a given user_firstname and user_lastname. So I want something like:

sql = "SELECT 'website' from ??? WHERE user_firstname = 'John' AND user_lastname = 'Allen'";

What is the table I need to access?

Thanks.
stevaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

William NettmannPHP Web DeveloperCommented:
The data is stored in the wp_posts and wp_postmeta tables. You can see all the field values by doing this:
SELECT website from 

(SELECT m1.meta_value as user_firstname, m2.meta_value as user_lastname, m3.meta_value as website
 FROM dev_posts
 join dev_postmeta m1 on m1.post_id = ID and m1.meta_key = '_field_1'
 join dev_postmeta m2 on m2.post_id = ID and m2.meta_key = '_field_2'
 join dev_postmeta m3 on m3.post_id = ID and m3.meta_key = '_field_3'
 where post_type = 'nf_sub') as v1

WHERE user_firstname = 'John' AND user_lastname = 'Allen'

Open in new window


The "x" in "_field_x" is the field ID in Ninja Forms.
stevaAuthor Commented:
Thank you William for laying that out!  Did that come from any Ninja documentation you could point me to?  

Ninja makes it so easy to create a form but then they seem to go silent on how to get back the data you put into the form.  Do they expect us to write code like you've provided, or is there a simpler interface somewhere?

Thanks again for your help.
Steve
William NettmannPHP Web DeveloperCommented:
Hi Steve,

No, that came from knowing how the WordPress database is laid out, and having a quick peek to see how Ninja is saving it's stuff. I suspect they may like you to purchase an extension or the pro version or something to easily access the data.

The submissions are custom posts, type "nf_sub" as you can see from the query.

All WordPress posts and pages are saved similarly, as is the data from many (not all) plugins.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.