Thread: Newbie Horror
View Single Post
Old 02-19-2008, 11:00 PM   #5 (permalink)
NathanH
The Wanderer
 
Join Date: Feb 2008
Posts: 9
Thanks: 1
NathanH is on a distinguished road
Default

Quote:
Originally Posted by maZtah View Post
This should do the trick:

PHP Code:
$szQuery 'SELECT gold FROM users WHERE id='.$iMemberId.' LIMIT 1;
$pResult = mysql_query($szQuery);

$aRow = mysql_fetch_array($pResult); 
HTML Code:
<table>
<tr>
    <td><?php echo $aRow['gold']; ?></td>
</tr>
</table>
Where $iMemberId is the id of the user that is logged in.

PS. There's no need to do a while loop, since you're only fetching one row.
Thank you very much maZtah :) I'll get onto that right when I wake up :)
NathanH is offline  
Reply With Quote