php - Mysql server has gone away - MySQL error 2006: -
when trying edit table data in 1 of databases, can't apply change because of error
"mysql error 2006: mysql server has gone away"`
this problem intermittent. did research on , came across post. (note: i'm not @ knowledgeable on databases , php). see mysql_ping pings server connection or reconnects if there no connection.
sounds great. issue how apply mysql_ping? go , it? ok apply or effect things?
my server runs off windows 2003, iis , have php 5.3.8. i've had here i'm battling understand it.
make subroutine/function includes mysql_ping
, , use insted of mysql_query
.
for example
<?php function my_query($sql) { if(!mysql_ping()) { if(!mysql_connect( /* add connection parameters here */ )) { trigger_error("database not avaible: " . mysql_error()); return false; } } return mysql_query($sql); } ?>
Comments
Post a Comment