MySQL server has gone away

Gestart doorMilan7 reacties58 weergaven

8 berichten · pagina 1 van 1

Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi,

Ik heb dus voor een proxie promoot website een scriptje gemaakt om te kijken of de websites nog in de lucht zijn, maar elke keer krijg ik de error MySQL server has gone away

Script:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
 * @author Milan Drossaerts
 * @for Bob Maas
 * @page check.php
 * @copyright 2009
 */[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]admin/config.php[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]//Database connectie[/COLOR]
[COLOR= #0000BB]$afzender[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$fetchen[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]afzender[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$hoi[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM settings"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[COLOR= #0000BB]$fetchen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$hoi[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM submission"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//De query om te selecteren[/COLOR]

[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]))[/COLOR][COLOR= #FF8000]//Even vaak uitvoeren als in database[/COLOR]
[COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](@[/COLOR][URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]]))[/COLOR][COLOR= #FF8000]//Kijken of de website iets bevat[/COLOR]
    [COLOR= #007700]{[/COLOR]
        [COLOR= #FF8000]//Als website bereikbaar, dan aantal waarschuwingen weer na 0 zetten?[/COLOR]
    [COLOR= #007700]}[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE submission SET offline = offline+1 WHERE url="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//Een offline bijschrijven, na aangegeven getal wordt e-mail verzonden[/COLOR]
    [COLOR= #007700]}
    
    
    
}[/COLOR]
[COLOR= #0000BB]$sqlt[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT offline FROM submission WHERE offline="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetchen[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]offline[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//Kijken welke websites al een aangegeven keer offline zijn geweest[/COLOR]
[COLOR= #0000BB]$sqle[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM submission"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//Weer gegevens ophalen[/COLOR]
[COLOR= #0000BB]$fetche[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqle[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]//Zorgen dat gegevens kunnen worden weergeven[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqlt[/COLOR][COLOR= #007700])[/COLOR][COLOR= #FF8000]//Even vaak uitvoeren als in database[/COLOR]
[COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO offlinewebsite (url, email) VALUES ("[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetche[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$fetche[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]mail[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//Gegevens van een website opslaan 5x of meer is offline geweest[/COLOR]
[COLOR= #007700]}[/COLOR]
[COLOR= #0000BB]$sqlmail[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT email, url FROM offlinewebsites"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][COLOR= #FF8000]//Email ophalen[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetchmail[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqlmail[/COLOR][COLOR= #007700]))[/COLOR][COLOR= #FF8000]//Weer zovaak uitvoeren als in database[/COLOR]
[COLOR= #007700]{[/COLOR]
            [COLOR= #0000BB]$to[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$fetchmail[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];[/COLOR][COLOR= #FF8000]//Naar welk e-mail adres versturen?[/COLOR]
            [COLOR= #0000BB]$subject[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$fetchen[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]];[/COLOR][COLOR= #FF8000]//Onderwerp[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"MIME-Version: 1.0"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"
"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Content-type: text/html; charset=iso-8859-1"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"
"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"From: $afzender <$afzender>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"
"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"X-Mailer: PHP v"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/phpversion"]phpversion[/URL][COLOR= #007700]().[/COLOR] [COLOR= #DD0000]"
"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$fetchen[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]];[/COLOR]
            [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$to[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$subject[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR][COLOR= #FF8000]//Mail verzenden[/COLOR]
[COLOR= #007700]}[/COLOR]
?>


Wie kan het oplossen?

#Milan
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
BUMB
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
1. Heb effe geduld voordat je bumpt
2. Ooit van Google gehoord?
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
1. Oeps... Dahct dat ik hem gister had geplaatstbloos2. Ja, maar niks gevonden wink
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
w00t, wat een slechte host als hij na 5 seconden dat al weergeeft redfaceredfaceredface
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$sqlt = mysql_query("SELECT offline FROM submission WHERE offline=" . $fetchen[offline] . "") or die(mysql_error());//Kijken welke websites al een aangegeven keer offline zijn geweest
$sqle = mysql_query("SELECT * FROM submission") or die(mysql_error());//Weer gegevens ophalen
$fetche = mysql_fetch_assoc($sqle);//Zorgen dat gegevens kunnen worden weergeven
while($sqlt)//Even vaak uitvoeren als in database


waarom offline selecteren waar offline dinges is
dan heb je offline toch al?

en dat while( en dan een mysql query dat kan niet
0
Milan

Lid · Topicstarter

Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oké, weer wat geleerd.. Dat offline dinges selecteren is gemaakt, omdat de eigenaar dat kan instellen wink
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren