Thread PHP - Chat: PHP - Chat (4 answers)
Opened by Gast at 2003-08-24 10:14

Gast Gast
 2003-08-24 10:14
#10142 #10142
ICh habe ein chat raum programmiert

Es geht eine while schleiße die einen stop von 1 sec eingebaut hat im Hauptfenster

Das geht ungefähr 10 min gut Zeit ist unterschiedlich

Dann stopt die schleife und dieser fehler wird ausgegeben

Fatal error: Maximum execution time of 30 seconds exceeded in /home/www/web640/html/test.php on line 86


Kann mir da jemand helfen?

-----------------------------------------------------------

<script LANGUAGE="JavaScript"><!--
function myScroll() {
window.scrollBy(0,100)
setTimeout('myScroll()',1000);
}

if (document.layers || document.all)
myScroll()

//--></SCRIPT>

<body bgcolor="#CCE2FC" text="#000000" link="#0000FF" alink="#0000FF" vlink="#0000FF">
<?php
##anfang neues

$chatzahl2 = mysql_query("SELECT * FROM chatter WHERE anchatter='all' or anchatter='$chatter' or anchatter='' or chatter='$chatter'");
$chatzahl = mysql_num_rows($chatzahl2);
$eintrag = 20;
$chattextanzahl = $chatzahl - $eintrag;

$bb22 = mysql_query("SELECT * FROM chatter WHERE anchatter='all' or anchatter='$chatter' or anchatter='' or chatter='$chatter' ORDER BY id ASC LIMIT $chattextanzahl,$eintrag");
while ($onchat22 = mysql_fetch_array($bb22)) {
$autor1221 = mysql_query("SELECT * FROM autoren WHERE id='$onchat22[chatterid]'");
$autor11 = mysql_fetch_array($autor1221);
if ($onchat22[anchatter] == 'all' || $onchat22[anchatter] == '' || $onchat22[anchatter] == $chatter || $onchat22[chatter] == $chatter) {
?>
<table border="0" cellpadding="0" width="650">
<tr>
<td width="300" valign="top">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="<?php if ($chatter == 'illusionen02') { Print"#ffffff"; } else { Print "#000000"; }?>">
<?php

if ($onchat22[chatter] == $chatter and $onchat22[anchatter] != 'all' and $onchat22[anchatter] != '') {
Print "$onchat22[anchatter] (privat)";
}
if ($onchat22[anchatter] == $chatter) {
Print "$onchat22[chatter] erzählt dir:";
}
if ($onchat22[anchatter] == 'all' || $onchat22[anchatter] == '') {
print "".date("j.m.Y H:i:s", $onchat22[zeit])."";
}
?></font>
<b><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#4C53FA">
<?php
if ($onchat22[anchatter] == 'all') {
if ($onchat22[chatterid] >= 1) {
print "$autor11[login]:";
} else {
print "$onchat22[chatter]:";
}
}
?></font></b>
</td>
<td>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="<?php if ($chatter == 'illusionen02') { Print"#ffffff"; } else { Print "#000000"; }?>">
<?php
print " $onchat22[text]<br>";
?></font></td>
</tr>
</table>
<?php
}


flush();
usleep(150000);
}
##ende neues
?>

<?php
##anfang altes
$alte2 = mysql_query("SELECT * FROM chatter");
$alte = mysql_num_rows($alte2);

$test = 1;
$zdatum = time();
while ($zdatum == $zdatum) {
$neue2 = mysql_query("SELECT * FROM chatter");
$neue = mysql_num_rows($neue2);





$test++;

if ($alte != $neue){

## ANFANG DER TEXT AUS GABE
$bb22 = mysql_query("SELECT * FROM chatter ORDER BY id DESC LIMIT 0,1");
$onchat22 = mysql_fetch_array($bb22);

$autor1221 = mysql_query("SELECT * FROM autoren WHERE id='$onchat22[chatterid]'");
$autor11 = mysql_fetch_array($autor1221);

if ($onchat22[anchatter] == 'all' || $onchat22[anchatter] == '' || $onchat22[anchatter] == $chatter || $onchat22[chatter] == $chatter) {

?>
<table border="0" cellpadding="0" width="650">
<tr>
<td width="300" valign="top">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="<?php if ($chatter == 'illusionen02') { Print"#ffffff"; } else { Print "#000000"; }?>">
<?php
if ($onchat22[chatter] == $chatter and $onchat22[anchatter] != 'all' and $onchat22[anchatter] != '') {
Print "$onchat22[anchatter] (privat)";
}
if ($onchat22[anchatter] == $chatter) {
Print "$onchat22[chatter] erzählt dir:";
}
if ($onchat22[anchatter] == 'all' || $onchat22[anchatter] == '') {
print "".date("j.m.Y H:i:s", $onchat22[zeit])."";
}
?></font>
<b><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#4C53FA">
<?php
if ($onchat22[anchatter] == 'all') {
if ($onchat22[chatterid] >= 1) {
print "$autor11[login]:";
} else {
print "$onchat22[chatter]:";
}
}
?></font></b>
</td>
<td>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="<?php if ($chatter == 'illusionen02') { Print"#ffffff"; } else { Print "#000000"; }?>">
<?php
print " $onchat22[text]<br>";
?></font></td>
</tr>
</table>
<?php

}

$alte++;
## ENDE DER TEXT AUS GABE
}

$zdatum = time();
mysql_query("UPDATE onchatter set linkchat='$zdatum' WHERE chatter='$chatter'
");

flush();
usleep(1000000);

}

##ende altes
?>
</body>
---------------------------------------------------------------

View full thread PHP - Chat: PHP - Chat