Need a lil help with game money code.
Posted: Mon Jun 21, 2010 4:44 pm
hello every one,
im maybe 4 days into learning php/mysql, im making a text bases sim game, and im having problems with making a money system that will work. all im wanting to do is display the players money on the screen for them to see, but when i tell it to find the money in the players account it will only display "Resource id #4", so i tryed to see if it could find a username and i get the same thing, so im stuck. so anyhelp would be very nice.
thx for your time
im maybe 4 days into learning php/mysql, im making a text bases sim game, and im having problems with making a money system that will work. all im wanting to do is display the players money on the screen for them to see, but when i tell it to find the money in the players account it will only display "Resource id #4", so i tryed to see if it could find a username and i get the same thing, so im stuck. so anyhelp would be very nice.
thx for your time
Code: Select all
<?php
session_start();
include('confff.php');
$loggedinuser = $_SESSION['username'];
$findusername = mysql_query("SELECT * FROM users WHERE username = '$loggedinuser'");
$nspoints = mysql_query("SELECT nspoints FROM users WHERE username ='$loggedinuser'");
if(isset($loggedinuser))
{
echo 'hello?<br/>';
echo $loggedinuser;
echo $findusername;
echo '<br>'.$nspoints;
}
else
{
header("Loction: loginpage.php");
}
?>