Ok here is my script. The problem that im having is that i want the table to post it like:
Level = whatever level you are
Experience = how much exp you have
but instead its doing this:
1
50
25
16
Level
Experience
Gold
Hp
Mana
Here is a link to my site to see the problem for yourself.
link to problem
does anybody know what i did wrong?
<?
session_start();
?>
<html>
<head><title>Power Sword stats</title></head>
<body><center>
<?php
$db="berone";
$link = mysql_connect("localhost", "Berone", "moltres");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$result = mysql_query( "SELECT user_name, level, experience,gold, hp, mana FROM users where user_name = '$user_name'" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows ranked players.<P>";
print "<table width=700 border=1>\n";
print "<table width=90 border=1>";
while ($get_info = mysql_fetch_row($result)){
foreach ($get_info as $field)
print "<tr><td><td>$field</td></td></tr>"
;
print" <tr><td>
Character</td>
</tr>
<tr>
<td>Level</td>
</tr>
<tr>
<td>Experience</td>
</tr>
<tr>
<td>Gold</td>
</tr>
<tr>
<td>Hp</td>
</tr>
<tr>
<td>Mana</td>
</tr> ";
while ($get_info = mysql_fetch_row($result)){
foreach ($get_info as $field)
print "<tr><td><td>$field</td></td></tr>";
}
}
print "</table>\n";
mysql_close($link);
?> </center>
</body>
</html>