capgrasdelusion wrote:That worked, but now I realized I will need to add a lot more stats to be retrieved and manipulated, could I retrieve it all in the same query, or would I have to redefine the query over and over?
Yes, you generally can retrieve all that you need with a single query.
capgrasdelusion wrote:remember that I need all of these querys stored in to session variables
No, you need the results retrieved to be stored in the session, not the query result resource itself, nor the SQL statement string.
capgrasdelusion wrote:i'm not quite sure why you used %s in the username query, it works, but I don't understand it
Read the PHP manual concerning [man]sprintf/man and [man]mysql_real_escape_string/man. In this case I did not use mysql_real_escape_string() because you might have used it earlier (or I just forgot, as the case may be), but typically I would not escape the variable until needed (since it could be used in another context where the escaping is wrong), so I would write:
$sql = sprintf("SELECT money FROM users WHERE username='%s'",
mysql_real_escape_string($username));
The primary advantage of this is that it can be clearer to read than concatenating the variables directly (but if you use the PDO extension or MySQLi extension then you can use prepared statements with named placeholders, and these are even easier to read and provide an even safer escaping functionality than mysql_real_escape_string()).