Ask coding questions

← Back to all posts
How to connect to an external mysql database?
baciotti (1)

I am trying to connect to mysql using php but the function is not working. I am receiving this error:

Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /home/runner/conexao.php:7 Stack trace: #0 /home/runner/carro_insert.php(6): include() #1 {main} thrown in /home/runner/conexao.php on line 7

<?php $servername = "sql10.freesqldatabase.com"; $database = "sss"; $username="ssss"; $password="ssss"; $conexao=mysqli_connect($servername, $username, $password, $database); ?>