PHP MySQL - 显示特定用户提交的已保存表单

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.