在iis 7中不断收到“PHP致命错误:调用未定义函数mysql_connect()”

I am very new to web development but am required to use iis 7 and php to pull data from a remote mysql database to be displayed in a series of webpages.

I installed iis 7 along with php fine and can run phpinfo() through a .php file from a browser by going to localhost/testphp.php , however, when I tried to connect to a mysql server using the function mysql_connect in another .php file I got the error in the title.

I am running php 5.6.15 and can't find much in the way of an answer for this.

I also don't seem to have a php.ini file (let alone know if I should have one) and phpinfo() tells me that my loaded configuration file is "(none)".

I'm at my wit's end trying to find a solution to this with as little experience as I have. Does anyone know how to solve this problem? If so I would much appreciate any help I can get.

Thank you!

As of PHP 5.5, MySQL is deprecated. http://php.net/manual/en/migration55.deprecated.php

You should go for alternative ( MySQLi for example ), or use older version of PHP.

As mentioned a couple of times the old MySQL stuff is deprecated. I would actually suggest looking at PDO instead of MySQLi too.

To check for the API you are wanting, check for the following in phpinfo():

Should be a section called "mysql" with something like:

enter image description here