Mysql/mysqli

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
looren
Level 2
Level 2
Posts: 67
Joined: Fri Apr 14, 2017 4:03 am

Mysql/mysqli

Post by looren »

Hi

I just installed PHP7 (cli) and mariadb locally on my machine. I'm used to be able to connect via mysql_connect when php+mysql is installed, but for some reason it only accepts mysqli functions in php.

In my php7 cli ini file there is only settings for "Pdo_mysql", "MySQLi" and "mysqlnd". The only mysql extension in the extension list is : extension=php_mysqli.dll, and it has been commented out. If I activate it, php lets me know it cant find the .dll.

Can someone shine some light on this for me ? I'm kinda confused as what to do in order to just use mysql_connect/mysql_query

User avatar
Alexiy
Level 3
Level 3
Posts: 173
Joined: Wed Mar 23, 2016 12:24 pm

Re: Mysql/mysqli

Post by Alexiy »

In PHP 7, many procedural methods like 'mysql_connect' have been either removed or deprecated in favor of object-oriented approach. Use MySQLI instead.

MichaelJohn
Level 4
Level 4
Posts: 257
Joined: Fri Dec 12, 2014 6:46 am
Location: UK

Re: Mysql/mysqli

Post by MichaelJohn »

The MySQL extension was deprecated with PHP5.5 whilst the MySQLi extension was introduced with PHP5. I imagine you installed WAMP.Did you do this via the Package Manager. Installing in other ways may lead to dependency problems!

looren
Level 2
Level 2
Posts: 67
Joined: Fri Apr 14, 2017 4:03 am

Re: Mysql/mysqli

Post by looren »

Oh, okay, I had no idea this was the case in php5 vs php7.

Thank you for the update on this issue !

Post Reply

Return to “Software & Applications”