Hi. I’m a super newbie to php and mysql. Please excuse me if my question is so basic.
On my website, users log in and purchase credits (real money) to buy some items.
( Simply, users pay real money through paypal and buy some game money to purchase game items)
When they purchase credits, their credit is updated to sql database.
I would like credits to be displayed when users logged in. displayed to the user him/herself only.
My simple rough algorithms planned is:
-
call the table in which personal info is stored from database from sql by query
<? mysql_connect("$host", "$uname", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");$musername = $_GET[‘user’];
$sql=“SELECT * FROM $tbl_name2 WHERE usName=’$musername’”;
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
?> -
confirm the userID is matching with the person who logged in.
-
display the credit info using echo.
My question is the part 2.confirm.
Once I call the table name in sql, how do i confirm the person who is logged in? and how do I make the credit info is shown to the person who owns it…?