I would admit to query your db only once.

Such as:

...Echo table header here...
$result = mysql_query ("SELECT Name, EventTimes1Score,EventTimes2Score, 
EventTimes3Score, EventTimes4Score, EventTimes5Score,EventAdd1Score, 
EventAdd2Score, EventAdd3Score, EventAdd4Score, EventAdd5Score, 
EventTake1Score, EventTake2Score, EventTake3Score, EventTake4Score, 
EventTake5Score from leaguetest", $connection);
// now you got a resultset with all the entries. Now you need to read it
row-wise 
While ($result) {
        $row=Mysql_fetch_row($result);
        ... echo table row here... access to the data via $row['Name'] and
so on...
}
...echo table footer here...



-----Ursprüngliche Nachricht-----
Von: John [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 18. Mai 2005 22:52
An: php-windows@lists.php.net
Betreff: [SPAMVERDACHT] - [PHP-WIN] Database Problem - Bayesian Filter
detected spam

I have code that querys a mysql server and then presents the result in a 
table.

The code works fine until I put it in a for loop to get one row at a time. 
The problem is that I dont get the required result or any error message.

If I reduce the number of iterations or decrease the amount of data 
requested per iteration then it works. But otherwise nothing.

Is there some maximum number of characters or something similar. It is only 
a small select query that returns a char and about 15 ints. It works with 2 
iterations all the time. Works with 3 very, very rarely and works with four 
or more never.

Sample lines below.

for($i = 0; $i < 3; ++$i)
{
    ...
    ...
    ...
    $result = mysql_query ("SELECT Name, EventTimes1Score,EventTimes2Score, 
EventTimes3Score, EventTimes4Score, EventTimes5Score,EventAdd1Score, 
EventAdd2Score, EventAdd3Score, EventAdd4Score, EventAdd5Score, 
EventTake1Score, EventTake2Score, EventTake3Score, EventTake4Score, 
EventTake5Score from leaguetest LIMIT $i,1", $connection);
...
....
}

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to