This is my fourth time im starting to learn PHP/MySQL/AJAX
All the times i tried, was boring, because i was learning only the syntax commands.
Now i do another way. I decided to build up something that i would like to call "its mine!" So it will probably be simple text-based mmorpg game.
Everything goes well until this:
Database MySQL scheme. How would i build the tables?
I mean, i know how, but i also know that there will be fields that will frequently change it self (UPDATE * FROM ..), like: Hit Point bar, user_expience, skill_lvl, money_in_pack, world money etc etc etc...
Now i can do some ideal scheme, items -> 1 table, users -> 2 tables, maps -> 1 table etc...
But i guess its wrong? I cant put static and low-changing fields with frequently changing fields right? because the UPDATE command will go through the whole table right?
so i need to put the static together and frequently fields to separate each in a table? I guess so... what you say guys?
BTW, someone mentioned me about byte arrays or something? what is that? any docs for that? he said the frequently fields you can put inside the programm those fields, in cache, with bytes? 000111000111, 0011 will be - 1, and 1100 will be 24, etc... actually i dont get the whole idea of this guy(friend of mine) so can anyone direct me to some documents about that?
Now back to DB scheme, how do i connect it? using ID as i already seen somewhere?
look at my pseudo-scheme:
Expand|Select|Wrap|Line Numbers
- users_table {
- +user_id AUTO_INCREMENT
- +primary_key(user_id)
- +user_continent(+nation) // by choosing your continent, user is automatically moves to speciefic server. (can be?)
- +user details (
- "loginname,firstname,
- lastname,age,
- dateofbirth,country,
- email,password,icq,
- referrer,textlogo
- chatcolor,sexselect");
- }
- usersprofiles_table {
- +uprofiles_id
- +user_id
- +user_perks // Choise of 3 perks. 3 possibilities to change.
- +user_ranks
- +user_levels // Depends on user's stats -> STR * INT * END * DEX / 1000 & = level.
- +displayname
- }
- userstatus_table {
- +status_id // Such as Administrator, SuperVisor, Moderator, Baron, VIP Player, Premium Player, Banned/Condemned
- +user_id
- }
- stats_table {
- +stats_id
- +stat_name
- +stat_req
- +stat_desc
- }
- user_stats_table {
- +ustats_id
- +stats_id
- +user_id
- +ustats_value
- +ustats_formula
- }
this is how do i see the scheme... now every table that is connected to users, i put user_id to load the table with users right?
im just stuck and dont get how to connect it all... if anyone give me an example from mine code with 2-3 table connected as it should be ill continue by this example myself.
Sorry for the salat. :) couldnt explain it better. :)