Well i'm wondering the best way to do something, this 'something' is a diary to test my PHP and stuff and im wondering whats the best way of storing diary entries?
I think the best way would be to have a MySQL database named 'Diary Entries' and then have tables named after each user? But what is the maximum size of one database/table as i dont want to have to spent alot of money on hosting, if i chose to release it..
So say i got 1000 members... how many databases would i need total to hold those? Because i dont want to have to fork out tons of money for databases if it becomes popular..
So yeh any suggestions, like the best way to do it?
The best way of doing...
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: The best way of doing...
The better way would be to have a single table called diary_entries for all users, with a column for user_id in addition to date, event, etc
That way all users access the same single table, but the select statement to retrieve data for any individual user should include WHERE user_id = <user>
That way all users access the same single table, but the select statement to retrieve data for any individual user should include WHERE user_id = <user>
Re: The best way of doing...
So whats the maximum size of one database, if i was to use your method?
Because once it reaches its maximum, there would need to be another database/table created... So yeh, anyone know the maximum size of one database or table?
Because once it reaches its maximum, there would need to be another database/table created... So yeh, anyone know the maximum size of one database or table?
Re: The best way of doing...
Depends of the server storage size or your quota. Also if you use auto increment primary key INTEGER type has it's limits. 'Unsinged' attribute helps to increase the INT range.
Re: The best way of doing...
So whats the maximum value of int, when using auto increment?
Re: The best way of doing...
Unsigned it has a maximum size of 4,294,967,295. You can use Bigint if you're worried, it goes all the way to 18,446,744,073,709,551,615 
From MySQL numeric types - http://dev.mysql.com/doc/refman/5.0/en/ ... types.html
From MySQL numeric types - http://dev.mysql.com/doc/refman/5.0/en/ ... types.html
Re: The best way of doing...
Haha thanks int sounds big enough to me though 
Thanks for all your help, if anyone has any other suggestions.. Feel free to post them!
Thanks for all your help, if anyone has any other suggestions.. Feel free to post them!