If you do a lots of things in one php script this usually takes some time and mysql can gone away π for this when you run new query you can run it with this function which will connect again to mysql if previous connection is closed from timeout
function run_query($sql){
global $link, $db;
if(!mysql_ping($link)){
$link = mysql_connect($db[‘host’], $db[‘user’], $db[‘pass’], true);
mysql_select_db($db[‘db’], $link);
}
return mysql_query($sql, $link);
}
ΠΠ°ΡΠΈΡΡ ΠΊΠΎΠΌΠ΅Π½ΡΠ°Ρ