/    Sign up×
Community /Pin to ProfileBookmark

First of all, hello.
I’m doing my first project about building a website. The user entering the site in my project, draws data to the database [online] and deletes it when exiting. Since I am alone on the local server, there is no problem, I save the data to phpMyAdmin and then delete it. But I have a question in mind, can I create a unique database for each user entering the site? What topics / codes do I need to address to do this?

Like :
`
–> save my facebook posts to database order by id
–> take my posts from database order by id
if( quit from page )
–> delete my posts from database
`

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmAug 26.2019 — You need to learn the proper wording for the things you need to do. You also need to learn how databases and tables work.

No - you don't want to make a new db for each user. You add a user-id to the table structure that you are saving these things in and use a single table in a single db.
Copy linkTweet thisAlerts:
@NogDogAug 26.2019 — Yep, the topic you "need to address" is the "relational" aspect of "relational databases" (RDBMS). You'll likely have a users table (or whatever you prefer to call it), and your posts table will include a "foreign key" column where you'll associate each post to a user via the user table primary key ID. You can then select all of a given user's post once you know their user ID, e.g.:
<i>
</i>select * from posts where user_id = 123 order by id
×

Success!

Help @phibershinigami spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...