-1

I have created a google cloud instance on Compute Engine. I want to check the connectivity using PHP code.

<?php
$dhost="my public IP";
$duser="username";
$dpassword="password";
$database="test";
$connection=mysqli_connect($dhost, $duser, $dpassword) or die("Could not Connect to SQL Server ");

?>

Getting the following error

Fatal error: Uncaught Error: Call to undefined function mysqi_connect() in /opt/lampp/htdocs/dbconnect.php:6

from my terminal i installed the following

sudo apt-get install mysql-server
 sudo apt-get install libapache2-mod-php7.0

Still the problem exists..

manasouza
  • 1,189
  • 1
  • 14
  • 26
raj
  • 311
  • 1
  • 9
  • 19

1 Answers1

0

So it was a typo error and it was solved after changing

mysqi_connect

to

mysqli_connect

In the php file.

Toni
  • 1,054
  • 7
  • 12