I'm trying to pull information from a table in mysql 'ptb_stats'. This is being pulled through 'user_id' specific so that each member of the site can only see their stats.
So far all that is happening is i'm getting the image echoed" on the page and the information being pulled just says array?
Any suggestions where im going wrong please?
Thanks
This is the function:
function get_stats() {
global $connection;
global $_SESSION;
$query = "SELECT s.location, s.nationality, s.hobbies, s.role, s.friends, s.height, s.weight
FROM ptb_stats s
WHERE user_id = \'$profile_id\'";
$stats_set = mysql_query($query, $connection);
confirm_query($query, $connection);
return $stats_set;
}
This is the fetch array:
<?php
$stats_set = get_stats();
while ($stats = mysql_fetch_array($stats_set)) {
?>
<table width="100%" border="0">
<tr>
<td width="13%"><?php echo "<img width=40px heigh=34px src=\"assets/img/icons/stats.png\"/>" ?></td>
<td width="25%"><?php echo " $stats"?> </td>
<td width="13%"><?php echo "<img width=40px heigh=34px src=\"assets/img/icons/stats.png\"/>" ?></td>
<td width="25%"><?php echo " $stats"?> </td>
<td width="13%"><?php echo "<img width=40px heigh=34px src=\"assets/img/icons/stats.png\"/>" ?></td>
<td width="20%"><?php echo " $stats"?> </td>
</tr>
<tr>
<td height="36"><?php echo "<img width=40px heigh=34px src=\"assets/img/icons/stats.png\"/>" ?></td>
<td><?php echo " $stats"?> </td>
<td><?php echo "<img width=40px heigh=34px src=\"assets/img/icons/stats.png\"/>" ?></td>
<td><?php echo " $stats"?> </td>
<td><?php echo "<img width=40px heigh=34px src=\"assets/img/icons/stats.png\"/>" ?></td>
<td><?php echo " $stats"?> </td>
</tr>
</table>
<?php
}
?>