KnowledgebaseHow can we help you?

Use MySQLi functions instead of MySQL

Certain versions of MySQL are vulnerable to a buffer overflow when a user-defined function is created. This would allow an authenticated attacker to gain control of the MySQL daemon. Note that successful exploitation of this issue is dependent upon the attacker possessing insert privileges on the MySQL function table; this mitigates the risk considerably.

So that is the reason why MySQL is disabled on Shared Servers.

Solution: For Example: Instead of using mysql_connect () , you need to use mysqli_connect () in order to make your website connect with the database.

Below is the code for mysqli_connect ():

<?php
$con = mysqli_connect("localhost","my_user","my_password","my_db");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
?>

 

For more reference, Click Here.

Was this answer helpful?

Also Read

Gen X Web Hosting
Have a question? Call us.
+91 94296 92542
10:00 am – 7:30 pm IST, Mon–Sat
Live chat, email & tickets 24/7
Hosting
Linux Shared Windows Shared Reseller Hosting Node X Virtual Cloud Dedicated Servers
Products
Register Domains Transfer Domains SSL Certificates n8n Hosting Business Email
Company
About Us Contact Us Blog Careers Affiliates
Support
Open Ticket Knowledgebase Support Center
HostAdvice Great Uptime Award for Gen X Web Hosting Gen X Web Hosting Reviews Gen X Web Hosting Reviews
Copyright © 2026 Gen X Web Hosting. All rights reserved.
Privacy Policy Terms of Use Site Map