Using mysql in new xampp | Disable Mysqli | easy migrate Mysqli to mysql used code in localhost.
If your using ‘mysql_query’ in your PHP code and your code is not working or giving ‘Fatal error: Call to undefined function mysql_connect()‘
it means you are using latest version of Mysql or you are using new xampp.
new mysql using PDO & Mysqli, you can check about mysqli here.
but if you want to use old mysql_query, you have to change in php.ini. Follow these step to use mysql instead of mysqli in new xampp.
- Open ‘xampp/php/php.ini’ in notepad or any editor.
- Search for ‘extension=php_mysql.dll‘ & ‘extension=php_mysqli.dll‘
- Now see which one is active e.g. ;;extension=php_mysql.dll or ;;extension=php_mysqli.dll‘
- It should be like :
extension=php_mysql.dll
;;extension=php_mysqli.dll
for using mysql. - Save file.
- completely restart xampp.
That’s it! 🙂
Enjoy Mysql instead of Mysqli .