I Just learnig the PHP scipt and Mysql. My question is a simple one , where should i use tables and database.
Im Trying to create small website which can be used to create account, So when users hits sign up. should I need to create database on his name or should i need to create table?
I was thinking to create database on his name and tables on his details like tables names as profile info , gender , date of birth and email
Is that way to do? because I just started it I really need to know it. Please help me. How do I save images and videos in My database MYsql ? I installed apache last night.
Can we create infinite databases and table or does it have any limit? I said infinite because I thought to create database on user name and set tables as profile info, recent logins and recent blogs etc. So how do i allocate them in MY sql
I thought to create database on his name and create tables based on his info. its easy to select him using mysql_select_db(“passig his name”).So where do I save his info? If i need to save his blogs where do I save them ? and when we go for tables? I thought to use tables for them.
So what would You suggest.
Thanks in advance
The usual approach is to create a database on a per-application basis.
Let’s say your Database was named MyHomepage; in this database you have the following Tables:
tbl_users, tbl_blogs, tbl_entries
tbl_users would, as the name implies, hold user data. It has a number of fields, for instance a User ID (Unique, Auto increment), a Username, a MD5 oder SHA encrypted password, and other information like gender and so on.
tbl_blogs, holds information about the blog-instances a specific user could have: BlogID, UserID (the id of the user the blog belongs to), BlogName and so on, maybe even which software needs to be installed for this blog.
tbl_entries would hold any entry made on any blog. An Entry would have an ID, BlogID, Title, Text.
A Database an a per-User basis is usually not needed, neither is a table on a per-User or per-Blog basis needed. However – you could do that if your provider allowed you to create unlimited databases, which is usually not the case. The number of databases, as far as I know, is only limited by the amount of free space on your harddrives.