One query per page - is it that bad?

mr_wiseman

New Member
I am creating RPG type game. I pull out player's information in every page loaded from two tables with JOIN (it is information about member: age, name, his all game's stats and etc) and sometimes this information is required for me, sometimes not at all. Two tables consists of ~60-70 rows. Here is an example:\[code\]$query = mysql_query("SELECT m.*, i.* FROM members AS m INNER JOIN information AS i ON n.m_id = s.m_id AND n.secret_code= '$code' AND n.password = '$password'") or die(mysql_error());\[/code\]I run this query every page. And I put this query on header.php file which is included in index.php file. I am doing everything through index.php file with including files, like that: If it is page \[code\]index.php?id=gym\[/code\] I include folder gym with all its files. What would you suggest me? Re-write all system and insert into each file a query which would pull out only necessary information? Use Sessions? But if I buy, for example, two items, how can I know when to get data on how much member has money? Thank you very much.
 
Back
Top