["solved", well, evaded] PHP's / Server's memory?
Moderator: General Moderators
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
["solved", well, evaded] PHP's / Server's memory?
My php outputs a table (mainly read from database), but if i add more rows to the database, then the browser (and php.exe) freezes. Then if i reduce amount of shown columns then it allows more rows to be shown.
I have lots of small include files, but the table itself isnt that big. 7 columns, 5 rows and it freezed.
Is it a problem related with my Apache/PHP settings or a Coding related problem?
I have lots of small include files, but the table itself isnt that big. 7 columns, 5 rows and it freezed.
Is it a problem related with my Apache/PHP settings or a Coding related problem?
Last edited by Shendemiar on Sun Feb 22, 2004 8:42 pm, edited 1 time in total.
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Now i did the following:
I put the page to load on my browser... it "freezed" and showed nothing. Then i killed the php.exe vie taskmanager, and isntantlly the page appeared completely and correctly to the browser.
The code also works smoothly on phped's debugger.
So any idea even of the directions that i should be looking into with this?
I put the page to load on my browser... it "freezed" and showed nothing. Then i killed the php.exe vie taskmanager, and isntantlly the page appeared completely and correctly to the browser.
The code also works smoothly on phped's debugger.
So any idea even of the directions that i should be looking into with this?
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
It didnt do enything, its just the same.
Ill put the code here if anyone can spot something obvious.
Ill put the code here if anyone can spot something obvious.
Code: Select all
<table width="100%" border="0" height="10"><tr><td> </td></tr></TABLE>
<table width="100%" border="0" cellpadding="4" cellspacing="4" class="border">
<tr><td>
<strong> Read Messages</strong>
</td></tr>
<tr><td class="inner">
<?php
##################################################################################
# Delete message
if ($_GETї'delete'])
{include "game_elements/diplomacy_read_delete.php";}
##################################################################################
# Echo Table headers
echo "<table class="text" width="100%" cellspacing=3 cellpadding=5>";
echo "<tr>";
echo "<td nowrap width="1%" class="header">Status</td>";
echo "<td nowrap width="1%" class="header">Sent</td>";
echo "<td width="1%" class="header">From</td>";
echo "<td width="1%" class="header">To</td>";
echo "<td width="99%" class="header">Message</td>";
echo "<td width="1%" class="header"> </td>";
echo "<td width="1%" class="header"> </td>";
echo "</tr>";
##################################################################################
# Make connection & Query messages
$mail = "Select * from users_mail where userid=$Player and gameid=$GameNumber order by 'isread' asc, 'from' asc";
$yhteys = mysql_connect($DBC1, $DBC2, $DBC3) or die ("Error on connect:" . mysql_error());
if(isset($yhteys))
{
mysql_select_db($DB, $yhteys);
$haku = mysql_query($mail, $yhteys) or die("Error in query: "$query"");
}
##################################################################################
# Select row color
$i=0;
while ($row = mysql_fetch_array($haku, MYSQL_ASSOC))
{
$i++;
if ($i % 2 == 0)
{
$A="1";
}
else
{
$A="2";
}
##################################################################################
# Choose apropriate picture
echo "<tr>";
$read="";
if ($rowї'isread']==0)
{
$read="<img src="includes/images/unread.gif" alt="Unread!">";
}
if ($rowї'isread']==2)
{
$read="<img src="includes/images/replied.gif" alt="Replied!">";
}
##################################################################################
# Print cell's
PrintCell("<div align="center">".$read."</div>","textrow$A","",2);
PrintCell($rowї'sent'],"textrow$A","",1);
PrintCell(nations($rowї'from']),"textrow$A","",0);
PrintCell(nations($rowї'to']),"textrow$A","",0);
PrintCell($rowї'message'],"textrow$A","",0);
$ID=$rowї'id'];
$del=$Link."diplomacy&act=read&delete=$ID";
$celltext="$del" onClick="_confirm('Delete this message?',''); return false;"><img src="includes/images/delete.png" border="0" alt="Delete"></a>";
PrintCell($celltext,"textrow$A","",0);
PrintCell("<div align="center"><a href="kana"><img src="includes/images/reply.png" border="0" alt="Reply/Forward"></a></div>","textrow$A","",0);
echo "</tr>";
##################################################################################
# End of while ($row = mysql_fetch_array($haku, MYSQL_ASSOC))
}
##################################################################################
# End stuff
mysql_free_result($haku);
echo "</td></tr></table></td></tr><tr><td><div align="right">";
echo "<strong>You have $i of 100 messages </strong>";
echo "</div></td></tr></table>";
$mailreaad=fetch_query("update users_mail set isread=1 where isread=0 and userid=$Player and gameid=$GameNumber");
?>-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Ok thanks, i will inspect it carefullu tomorrow...LiLpunkSkateR wrote:well, an infinite loop isn't really an error, so php wouldn't catch it
it would keep going through the loop, over and over again, until you told it to stop (killing php.exe), then it would spit w/e it's done so far to the browser.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: