Hi!
I have this strange problem. This script get data from database and output it in html columns ($z). its all right but script is not optimize. I wait long time to execute query!
<table>
<?
$conn = db_connect();
$b = 10 ; //numbers to count for
$i = 0; // incrementor
$z = 3; // how much cols ?
$select = "select * from my_table";
$query1 = mysql_query ($select);
while($i < $b)
{
while ($row = mysql_fetch_array ($query1)) {
if($i == 0 || $i == $a)
{
echo "<tr>";
$a = $a + $z; // the beginning ist always $a + cols per row or zero
$e = $a - 1; // the end ist always $a - 1 ;
if ($e > $b) // if the end ist geater then our count
{
$e = $b - 1; //we make $b - 1 and thats the end tag
}
}
echo "<td> ". $i . $row [0] ." </td>";
if ($i == $e)
{
echo "</tr>";
}
$i++;
}
}
?>
</table>
I have an massage:
Fatal error: Maximum execution time of 60 seconds exceeded in ....
Any idеa for optimize script? Thanks!