PHP connection issue in mac
<p>i'm using <strong>MAMP</strong> on mac os 
This is the error while making database connection</p>

<p>Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /Applications/MAMP/htdocs/databases.php:3 Stack trace: #0 {main} thrown in /Applications/MAMP/htdocs/databases.php on line 3</p>

<p>Code used</p>

<pre><code>&lt;?php 

$connection = mysql_connect("localhost","root","");

if(!$connection)
{

    die("Database connection failed" . mysql_error());
}
?&gt;
</code></pre>