简体   繁体   中英

PHP MySQL - Display saved forms submitted by a specific user

I'm an up an coming developer trying to develop an online ordering system. Basically users will login to a system, create a form, save a form and display previously saved forms.

I can create a login system, i can create a form, and i know how to save/edit the forms but my problem is how do i only show forms submitted by specific users. If Joe logs into the system, i only want Joe to be able to see his saved forms.

Should i have a form database per user? Should i just have a login database and one single form database for all users?

It would work to have two tables inside your database:

  • users for storing user info. It should have things like a unique ID column, the user's name, email...
  • forms for saved forms. It should have a user_id column so you know for any given form what user saved it. This stores the the fields in the form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM