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

Okay, i'm guessing this is either not going to be possible or i'm just very stupid and have overlooked it. Probably the latter, but i'm learning :P

I've been trying to (it's going to sound easy) get a value out of the database and into a table cell. I can do that, but I need to take a member specific value out. As in, I can take out a value, but i can only show all values or only one, and it would be the same for everyone.

Maybe i'm not clear enough - i'm trying! :)

I'll give you the scenario:
- I have one table: 'users',
- I have 4 fields: 'ID', 'username', 'password', 'gold',
- I am trying to paste the member's gold on a page.

My code:
Code:
$showgold = "SELECT * FROM users";
$query = mysql_query($showgold);
while($row = mysql_fetch_array($query))
{
echo "<table>";
echo "<tr>";
echo "<td>" . $row['gold'] . "</td>";
echo "</tr>";
echo "</table>";
}
This shows me every member's amount of gold. What i'm trying to have is just the member seeing their amount of gold. I've been looking for an answer more or less all day. Maybe you guys/girls could help? :)

Thanks
NathanH is offline  
Reply With Quote