0

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!

Tesnich
  • 37
  • 4
  • 1
    http://php.net/manual/en/function.mysql-connect.php That method is deprecated. If you have a page with phpinfo() make sure you have the proper module installed and loaded in order to use the function. – Kris Oye Nov 25 '15 at 05:20
  • Possible duplicate of [Why shouldn't I use mysql\_\* functions in PHP?](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) – Memor-X Nov 25 '15 at 05:30
  • Possible duplicate of [Fatal error: undefined function - why?](http://stackoverflow.com/questions/1150108/fatal-error-undefined-function-why) – Vladislav Rastrusny Nov 25 '15 at 08:53

2 Answers2

0

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.

Tom
  • 3,009
  • 1
  • 18
  • 23
0

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

Kris Oye
  • 1,158
  • 14
  • 27