ID: 15143
Comment by: [EMAIL PROTECTED]
Old Reported By: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Apache related
Operating System: Win 2K
PHP Version: 4.1.1
New Comment:
[EMAIL PROTECTED], try executing the script via the command prompt in
Win2k, ex:
start->run: "cmd"
cd web\php
php.exe -f myscript.php
If that hangs, something is amiss indeed. If it just keeps spitting out
HTML, the loop is going on forever, which is bad. :-)
Also a totally off the topic thought, if you are going to be using
subqueries, look into other databases that allow recursive queries.
Previous Comments:
------------------------------------------------------------------------
[2002-01-22 15:32:16] [EMAIL PROTECTED]
This same problem doesn't occur on Redhat with Apache, php, and mysql.
Are there limitations to php.exe on win2k?
------------------------------------------------------------------------
[2002-01-21 11:54:57] [EMAIL PROTECTED]
The selects in a loop is what does it. If I remove the select
statement it seems to work fine in this program. Is there some kind of
limit to how many selects on php page can handle? or am I not
releasing the sql functions correctly? I also notice that everytime I
have a page loading I see a new process for php.exe in the process tab
under task manager.
while($row = mysql_fetch_array($result)) {
$select="select winner from user_picks where round=3 and
nickname='".$row["nickname"]."'";
$result2 = mysql_db_query("football",$select);
$row2 = mysql_fetch_array($result2);
$nickname = urlencode($row["nickname"]);
echo "<tr><td><center><img
src=\"images/icons/".$row2["winner"].".gif\"></center></td>";
echo "<td><font size=+1><center>".$cnt."</center></font></td>";
echo "<td><font size=+1><center><a
href=\"picks.php?nickname=".$nickname."\">".$row["nickname"]."</a></center></font></td>";
echo "<td align=right><font size=+1>".$row[1]."</font></td>";
$percentage=round($row[2]/$row_tot[0]*100);
echo "<td align=right><font
size=+1>".$percentage."%</font></td></tr>";
mysql_free_result($result2);
$cnt++;
}
------------------------------------------------------------------------
[2002-01-21 09:46:16] [EMAIL PROTECTED]
Can you simplify the code and track down the problem to only a few
lines of code?
------------------------------------------------------------------------
[2002-01-21 09:37:25] [EMAIL PROTECTED]
This code doesn't seem to work with more than 20 people. I had it
working great with 12 and then I added all 61 and the page just sits
there and doesn't load. On IE or Netscape so it is the Apache or PHP.
I am using the php.exe in apache not the module. I couldn't get the
module to work correctly. I am using the latest stable versions of
apache, mysql, and php. I also am using the mysql-nt-max. I don't
think it is a problem with mysql cause I had a simular problem with a
calendar program, yet when I didn't have tables (loop in a loop, just
listed it straight out) it worked fine.
When I eliminate the tables in this program I get up to about line 20
before it just hangs forever. I waited about 3 hours to see if it
loaded and it never stops trying.
<html>
<head>
<title>Football Playoff Picks Standings</title>
</head>
<body bgcolor=#ffffff>
<?php
$select="select a.nickname, round(sum(pow(2,a.round+1))),sum(1) from
user_picks a, actual_wins b where a.round=b.round and
a.division=b.division and a.winner=b.winner group by nickname order by
2 desc, 1 desc";
$select_tot="select sum(1) from actual_wins";
mysql_connect("localhost","root","Ushouldn'tBhere");
$result = mysql_db_query("football",$select);
$result_tot = mysql_db_query("football",$select_tot);
$row_tot = mysql_fetch_array($result_tot);
echo "<center><table border=1>";
echo "<tr><td></td><th><font size=+2>Place</font></th><th><font
size=+2>Nickname</font></th><th><font
size=+2>Points</font></th><th><font
size=+2>Percentage</font></th></tr>";
$cnt = 1;
while($row = mysql_fetch_array($result)) {
$select="select winner from user_picks where round=3 and
nickname='".$row["nickname"]."'";
$result2 = mysql_db_query("football",$select);
$row2 = mysql_fetch_array($result2);
$nickname = urlencode($row["nickname"]);
echo "<tr><td><center><img
src=\"images/icons/".$row2["winner"].".gif\"></center></td>";
echo "<td><font size=+1><center>".$cnt."</center></font></td>";
echo "<td><font size=+1><center><a
href=\"picks.php?nickname=".$nickname."\">".$row["nickname"]."</a></center></font></td>";
echo "<td align=right><font size=+1>".$row[1]."</font></td>";
$percentage=round($row[2]/$row_tot[0]*100);
echo "<td align=right><font size=+1>".$percentage."
%</font></td></tr>";
mysql_free_result($result2);
$cnt++;
}
echo "</table></center>";
mysql_free_result($result);
?>
</body>
</html>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=15143&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]