Advanced INSERT and SELECT queries?
I really cant wrap my head around how to write queries that use more then one table.
What im trying to do is set up a account for a player. So when they register it set up in members table. Things like id, username, name, age and so on and then using that id insert into another game_table of their game profile. id, level, health, ...
How do i write something like this in one query. Initially when they register all the values in the game_table will be their default values so i only need to create a row where the id = the id from the members_table and the rest of the values default.
And when a user logs in i have a select query that searches the members table to see if the username and password feilds match but i also want to retrieve the values from the game_table for the same id.
I have a rough idea of how it works but when i try writing it...
So basically i want to select everything in the game_table where game.id = members.id only if members.username = $_post(username) and members.password = $_Post(password)
Hope this makes sense