-3

Warning: mysql_query(): MySQL server has gone away in C:\xampp\htdocs\mk_buktyas\siapuas\menu\home.php on line 90

Warning: mysql_query(): Error reading result set's header in C:\xampp\htdocs\mk_buktyas\siapuas\menu\home.php on line 90

MySQL server has gone away

Barmar
  • 741,623
  • 53
  • 500
  • 612
Arivai
  • 1
  • 1
  • 1
  • 2
    also post your code. – Hikmat Sijapati Jan 01 '17 at 06:26
  • This error usually means your query has crashed the MySQL server. But if it happens in exactly 60 seconds, see http://stackoverflow.com/questions/1644432/mysql-server-has-gone-away-in-exactly-60-seconds?s=1|0.0000 – Barmar Jan 01 '17 at 08:03
  • Does this answer your question? [MYSQL server has gone away](https://stackoverflow.com/questions/1801794/mysql-server-has-gone-away) – Moradnejad Mar 10 '20 at 10:50

2 Answers2

0

First of all please post your error with code.But I have made answer because your error is looks like due to the use of mysql extension.So use mysqli extension.Or you can also use php data objects pdo exttension.

so replace your code

mysql_query($connection,$sql);

To

mysqli_query($connection,$sql);

Where $connection is database connection object and $sql is your sql query that you want to execute.

Note: mysql extension is deprecated and removed from php7.So here you have to use mysqli stands for mysql-improved.

Hikmat Sijapati
  • 6,869
  • 1
  • 9
  • 19
-1

IT IS SURE THAT YOUR ISSUE WILL BE RESOLVED

  1. JUST GO TO XAMPP-CONTROL, CLICK ON THAT, YOU WILL FIND CONFIGURE BESIDE MYSQL SERVICE. CLICK ON THAT ON MY.INI FILE/ YOU CAN FOLLOW THIS PATH "XAMPP/MYSQL/BIN/MY.INI"
  2. NOW SEARCH WITH THIS "max_allowed_packet" ON MY.INI. YOU WILL GET THE VALUE 1M, JUST SET THIS VALUE TO 1000M
  3. NOW GO TO XAMPP-CONTROL[EXECUTABLE FILE]/SERVICE/MYSQL AND RESTART THE MYSQL