I've been trying to create a game which you register and login, and stores the data (username, pass etc.) within mySQL. But I can't seem to figure out a way to find which row from mysql that the person is logged in, and show the information for it.
For exmaple, when you login, you go to your base, and it shows some stats;
like attack, def, spy and sentry
and it'll show them as
Attack: [number, get from mysql]
etc.
So what do I do? maybe
Code: Select all
<?php
$username = "";
$attackquery = "SELECT FROM `accounts` where `username`="$username";
$attack = mysql_connect($attackquery);
?>
Attack Rating: <?php echo "$attack" ?>