It seems I have an issue with running my website in production and localhost in parallel due to some DB issue.
I run my PHP site on localhost using XAMPP, the website communicates with a database hosted on Godaddy. I get the following errors:
Warning: mysqli_query(): Premature end of data (mysqlnd_wireprotocol.c:942) in menu.inc.php on line 5 Warning: mysqli_query(): EOF packet 1 bytes shorter than expected in menu.inc.php on line 5 Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in menu.inc.php on line 6
menu.inc.php line 5 and 6 are the first mysqli_query and mysqli_fetch_assoc commands on the site.
When those warnings appear, no data is retrieved from the DB.
However, If I go to GoDaddy CPanel and click on "repair database" and then connect from loaclhost - if works on localhost. But the production version of the site (also on GoDaddy) stops working ! The errors are not displayed, but the data is not retrieved and not displayed from DB.
It looks like only the first connection to the DB works and the second fails constantly ?
What might be the issue?