I am currently attempting to migrate my website from MVC asp.net to PHP after experiencing numerous issues with my host provider. The initial changes have proved easy with PHP being quite simple to get to grips with. However, I have hit a brick wall for the last few pages that require interaction with an SQL database.
I have worked through a number of different tutorials and helps and each one leads to the sample problem.
function db_connect()
{
$conn = mysql_connect ('localhost', 'root', '') or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ('Database');
return $conn;
}
Which returns the error "Call to undefined function mysql_connect()" on the first line.
I have checked the php.ini file and this seems correct
; extension_dir = "./"
; On windows:
extension_dir = "C:\Program Files\Jcx.Software\VS.Php\2013\php 5.4\ext"
extension=php_mysql.dll
And the dll is in the corresponding directory.
I think I am probably missing something really obvious, but would appreciate any help someone can give me.