Anyone who has any idea how to resolve this issue.
While creating pdf if it takes more then few minutes then mysql connection is not working. To overcome this issue I have recreated the mysql connection but it is giving below error.
Code
<?php
$query = "INSERT INTO plotch_vendor_invoice(" . implode(', ', array_keys($fields_arr)) . ") VALUES ('" . implode("', '", $fields_arr) . "')";
echo "\n $query \n";
$resultSet = mysql_query($query, $this->dbConn);
if(!$resultSet){
echo '\n Mysql Reconnect \n';
$this->dbConn = mysql_connect(HOST_NAME, USER_NAME, PASSWORD) or die("Couldn't connect.");
mysql_select_db(DB_NAME, $this->dbConn) or die("Unable to select database"); //Mysql Reconnect \nUnable to select database
mysql_query($query, $this->dbConn);
}
?>
ERROR: PHP Warning: mysql_query(): MySQL server has gone away in PHP Warning: mysql_query(): Error reading result set's header in Mysql Reconnect \nUnable to select database