Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 27th Dec 2009, 11:38 AM   #1
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
Default
Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

I`m a beginner , this is my first project using php and mysql. I`m creating something like a browser-based game. I have a table for users , with 10 rows (but i`m adding more and more rows daily) and I need to create a new table to store the results of every mission of a given player. The problem is that I want to create more than 100 missions so thats mean more than 100 rows for the missions table. My question is how would be the best to store the missions result , and how many users can have my website , is there a limit for mysql ?:confused:

coolboycsaba is offline  
Unread 27th Dec 2009, 11:54 AM   #2
People Know Me
War Room Member
 
aaron_nimocks's Avatar
 
Join Date: 2006
Location: Virginia Beach
Posts: 705
Thanks: 30
Thanked 138 Times in 115 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

I wouldn't worry about a limit. MYSQL can handle it.

If I am getting you right I would...

Create a table for missions.
Then each row would hold the missions specifics.

Create a table for users.
Then each row would hold the info for the user. Login/Password and specific data that you want to hold. (points, missions completed, name, ect.)

Not sure all the info you need to save for each mission but I would just save it all on the specific user row.

My free PSD logs can be downloaded at PSD Bum. Enjoy!
aaron_nimocks is offline  
Unread 27th Dec 2009, 12:16 PM   #3
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by aaron_nimocks View Post

I wouldn't worry about a limit. MYSQL can handle it.
Mysql can handle 1.000.000 users in a single table ?

coolboycsaba is offline  
Unread 27th Dec 2009, 12:30 PM   #4
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Yes.

If you are worried about performance, then it's a good idea to keep track of the execution time of your application as well as the database performance and the query execution time.
Manfred Ekblad is offline  
Unread 27th Dec 2009, 12:32 PM   #5
People Know Me
War Room Member
 
aaron_nimocks's Avatar
 
Join Date: 2006
Location: Virginia Beach
Posts: 705
Thanks: 30
Thanked 138 Times in 115 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by coolboycsaba View Post

Mysql can handle 1.000.000 users in a single table ?
Sure. People have tested with billions.

The more you have in there the slower it will be. Keep that in mind when building it.

You may want to make more tables so theres less rows in each.

Mission 1
Mission 2
Mission 3

etc.

The more rows you have the longer it takes to find the row when doing a search in that table.

My free PSD logs can be downloaded at PSD Bum. Enjoy!
aaron_nimocks is offline  
Unread 27th Dec 2009, 12:42 PM   #6
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Yes, and while you're at it, build a database cluster as well and don't forget to have it all memcached kidding... but here is a link to some stuff about database performance and optimizing MySQL queries using indexes.

Optimizing MySQL: Queries and Indexes

What's your online game about anyway?
Manfred Ekblad is offline  
Unread 27th Dec 2009, 01:18 PM   #7
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Thanks for all these replies ! Now I`m no more worried :d

coolboycsaba is offline  
Unread 27th Dec 2009, 01:19 PM   #8
Enthusiastic Warrior
War Room Member
 
Join Date: 2009
Posts: 800
Thanks: 201
Thanked 213 Times in 166 Posts
Blog Entries: 4
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by coolboycsaba View Post

I`m a beginner , this is my first project using php and mysql. I`m creating something like a browser-based game. I have a table for users , with 10 rows (but i`m adding more and more rows daily) and I need to create a new table to store the results of every mission of a given player. The problem is that I want to create more than 100 missions so thats mean more than 100 rows for the missions table. My question is how would be the best to store the missions result , and how many users can have my website , is there a limit for mysql ?:confused:
Hi, here's what I recommend.

Have a USER table. This includes user ID number column, which is an id field, not null, auto increment, and also includes a user name column. Whatever else you want to keep track of about users - other than their missions - goes here.

Have a MISSION table. This includes a user ID number column to cross reference the user for each mission. Include a foreign key constraint to guarantee that each mission is associated with a valid user.

Look for a how-to article on database normalization, because this is a perfect start to your system.
Mr. Enthusiastic is offline  
Unread 27th Dec 2009, 01:27 PM   #9
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

another question :d
Now i`m using a free webhost for testing the website before releasing it and at my cp I saw that i have a mysql size limit of 9mb , what is that meaning and how many places is needed to store 1.000.000 users each with 100 missions ?

coolboycsaba is offline  
Unread 27th Dec 2009, 01:30 PM   #10
People Know Me
War Room Member
 
aaron_nimocks's Avatar
 
Join Date: 2006
Location: Virginia Beach
Posts: 705
Thanks: 30
Thanked 138 Times in 115 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by coolboycsaba View Post

another question :d
Now i`m using a free webhost for testing the website before releasing it and at my cp I saw that i have a mysql size limit of 9mb , what is that meaning and how many places is needed to store 1.000.000 users each with 100 missions ?
If you are testing then you wont have a million users. That size should be good enough to make your game and test it before moving it to a server. This size of the game and users it seems you are expecting you will probably need an expensive server.

My free PSD logs can be downloaded at PSD Bum. Enjoy!
aaron_nimocks is offline  
Unread 27th Dec 2009, 01:32 PM   #11
Enthusiastic Warrior
War Room Member
 
Join Date: 2009
Posts: 800
Thanks: 201
Thanked 213 Times in 166 Posts
Blog Entries: 4
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by coolboycsaba View Post

another question :d
Now i`m using a free webhost for testing the website before releasing it and at my cp I saw that i have a mysql size limit of 9mb , what is that meaning and how many places is needed to store 1.000.000 users each with 100 missions ?
Your free host will likely shut off your account for excessive usage before you get to a million users. With a million users, you should be able to easily afford to pay for an appropriately sized servers.

With a 9 megabyte limit and one million users, you'd get to have nine bytes per user. Considering that first and last name alone are likely to run to 20 or 30 bytes, there's no way your free host could be suitable for what you envision. If you let people choose a login ID and password, enter their email address, and have any kind of user profile information, you're likely up to hundreds of bytes per user even before they have their first mission. That would let you have something like 3,000 users per MB if none of them have any missions.

Since you haven't said anything yet about what's involved with the missions, there's no way to speculate how large your missions table will grow or whether it will need additional tables to keep track of each mission's details.
Mr. Enthusiastic is offline  
Unread 27th Dec 2009, 01:37 PM   #12
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by coolboycsaba View Post

another question :d
Now i`m using a free webhost for testing the website before releasing it and at my cp I saw that i have a mysql size limit of 9mb , what is that meaning and how many places is needed to store 1.000.000 users each with 100 missions ?
The database data is stored in files which occupies a bit of disk space. In your case, the web host has set your limit to 9MB. So, you are allowed to store data up to the limit of 9MB.

How much space do you need? That depends on what kind of data you store in the user and mission table. You can google "how to calculate the size of mysql database" to find out more.

But, in your case, I would recommend that you grab a copy of XAMPP so that you can test your web application on your own computer.
Manfred Ekblad is offline  
The Following User Says Thank You to Manfred Ekblad For This Useful Post:
Unread 27th Dec 2009, 01:46 PM   #13
Enthusiastic Warrior
War Room Member
 
Join Date: 2009
Posts: 800
Thanks: 201
Thanked 213 Times in 166 Posts
Blog Entries: 4
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Manfred's got a great idea there.

If the game really does have a million-user potential, then you should spend all of your time raising money, establishing a business structure, and hiring (or making joint venture, profit-sharing deals) with programmers who already know how to program a site that large.

Trying to do something like this on your own makes no more sense than Donald Trump taking a year off to learn how to weld before he makes a new skyscraper deal, or Richard Branson learning how to be a 747 pilot before expanding his airline.
Mr. Enthusiastic is offline  
Unread 27th Dec 2009, 05:16 PM   #14
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: 2009
Posts: 76
Thanks: 10
Thanked 0 Times in 0 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

I have a good idea: I will add 2 new rows to the users table: mission id and missionenddate
I will create a table: missions , where I will add each mission like the users (in 5rows) .

coolboycsaba is offline  
Unread 28th Dec 2009, 10:40 AM   #15
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: Php and Mysql help needed
Share on: 
fb share twitter share gplus share more share

Originally Posted by coolboycsaba View Post

I will add 2 new rows to the users table: mission id and missionenddate
You mean columns, not rows.
Each indivdual record is a row.

You might actually want to put mission_id and mission_end_date in a seperate table and include the user_id.
KirkMcD is offline  
Closed Thread


Bookmarks

Tags
mysql, needed, php


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 11:23 AM.