Hi
I am select something from the DB and counting it.
On the localhost on my own computer it works but on my server it crashes. Most likely for different versions of mysql / php!?
Here is the code, is there some other ways to write this? so the server doesnt crash:
$num = mysql_num_rows($result);
$i=1;
if($i < $num)
{
echo "<table border='1' width='100%'>";
echo "<tr><th>#</th><th>" . ucf(translate('country')) . "</th><th>" . ucf(translate('navn')) . "</th><th>" . translate('date') . "</th><th>" . ucf(translate('bodyweight')) . "</th><th>". translate('lifted') ."</th></tr>";
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array( $result ))
{
// Print out the contents of each row into a table
echo "<tr><td align='center'>";
echo $i++; // Krasj??
echo "</td><td align='center'>";
echo "<div><img src='img/flags/16/". strtolower($row['user_country']) .".png' /></div> " . translate(ucf(getCountryName(strtolower($row['user_country'])))) . "";
echo "</td><td align='center'>";
echo "<a href='index.php?action=profile&sub=show&tid=". $row['training_id'] ."'>" . getNameFromId($row['user_id']) . "</a>";
echo "</td><td align='center'>";
echo formatDate($row['date'], $dateformat);
echo "</td><td align='center'>";
echo r_nr2(calcFromKg($row['bodyweight'])). $w_metric;
echo "</td><td align='center'>";
echo r_nr(calcFromKg($row['kg'])). $w_metric;
echo "</td></tr>";
}
echo "</table>
<div class='fixed'>
</div>
</div>
</div>
<div class='fixed'>
</div>
<div id='footer'>
<a id='gotop' href='#' onclick='MGJS.goTop();return false;'>" . translate('top') . "</a>
<div align='center' id='copyright'>© " . translate('copyrightyear') . " " . translate('header_text'). " - " . translate('curversion') ." - <a href='index.php?action=contact'>" . translate('contact') ."</a> - <a href='index.php?action=about'>" . translate('about') . "</a> - " . translate('onlineusers'). ": " . getActiveUsers() . "<br />
</div>";
exit;
}
else
{
blablabla
Versions:
Local: php mysql 5.3 mysql 5.1.36
Server: php 5.29 mysql 5.0.87
I hope there is someone who sees something I have not seen here: P hehe ..
Thanks for the reply