Re: Database Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In short, there isn't a restriction to the number of iterations.

So I suspect it's something to do with you code.

Can I make the following suggestions

1) assign the SQL statement into a variable $SQL, for example. Print that out before your call to mysql_query()
echo $SQL . "<br>";
$result = mysql_query($SQL,$connection);


2) Check on the result returned from MySQL.

try the last successful and the first failed query through the command line. You might learn something, at least I hope you do!

all the best,

graeme.

John wrote:

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);
...
....
}





-- Experience is a good teacher, but she sends in terrific bills.

Minna Antrim

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux