1

I keep on getting this error I dont know when it started. Sometimes my program runs without that error sometimes it has this error. Please help!!

I have uploaded file same as this one with error but when i look at the webpage it is running smoothly

I tried changing ports and restarting my wamp but it doesnt get any better

Warning: mysql_select_db(): Error while reading INIT_DB's OK packet. PID=8808 Warning: mysql_select_db(): MySQL server has gone away in connection on line 4

Line 4 ----> mysql_select_db('dbname')

ve_1992
  • 19
  • 6
  • 1
    any abnormal information in mysql server's log? – yaoweijq Apr 19 '18 at 01:35
  • 2
    If you're writing new code, **_please_, in the name of all you hold dear, don't use the `mysql_*` functions**. They are old and broken, were deprecated in PHP 5.5, and completely removed in PHP 7.0 (which is so old it [no longer even receives active support](http://php.net/supported-versions.php)). Use [`PDO`](https://secure.php.net/manual/en/book.pdo.php) or [`mysqli_*`](https://secure.php.net/manual/en/book.mysqli.php) with _prepared statements_ and _parameter binding_ instead. See http://stackoverflow.com/q/12859942/354577 for details. It's 2018 and this isn't funny anymore. – ChrisGPT was on strike Apr 19 '18 at 01:54

1 Answers1

0

I think Now will be fined;

mysqli_connect("localhost","root","password","dbname");
Ericgit
  • 6,089
  • 2
  • 42
  • 53