mysql_connect error?

Hi, I am using some PHP functions that call mysql_connect().
In my php.in file I have the proper extension directory, I also according to
things that I read have un-commented the line extension=php_mysqli.dll but every
time I tried to load the file I get this error. “Fatal error: Call to undefined
function mysql_connect() in C:\Apache24\htdocs… on line 22”. My question is if
I am using the mysqli extension should I still be calling mysql_connect() or is
there some better way to call a function to do it’s task. I am using PHP 5.5.15
and Apache2.4.10 on Windows with a individual install of MySQL, Apache, and PHP (not a package like XAMPP). I could be mistaken but I have used just mysql_connect with
the mysqli extension before. Thanks

If you are using the mysqli (improved) dll you should be using the mysqli functions or PDO with the mysql wrapper dll

extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll

BTW smart of you to get away from the deprecated mysql functions :thumbsup:

Thanks so much! Why do we still uncomment the extension=php_mysql.dll? Is it just in case we run into older code?

That’s from my localhost and I haven’t bothered to comment it out yet.

I don’t use it so there is really no reason for me not to other than laziness being too busy.

But no, AFAIK it doesn’t need to be uncommented if you aren’t running older code.

Great, this helped a lot. Thank You.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.