1
votes

An uncaught Exception was encountered

Type: Error

Message: Call to undefined function mysql_connect()

Filename: C:\xampp\htdocs\Salab\system\database\drivers\mysql\mysql_driver.php

Line Number: 136

Backtrace:

File: C:\xampp\htdocs\Salab\application\third_party\MX\Loader.php Line: 109 Function: DB

File: C:\xampp\htdocs\Salab\application\third_party\MX\Loader.php Line: 65 Function: initialize

File: C:\xampp\htdocs\Salab\application\third_party\MX\Base.php Line: 55 Function: __construct

File: C:\xampp\htdocs\Salab\application\third_party\MX\Base.php Line: 60 Function: __construct

File: C:\xampp\htdocs\Salab\application\third_party\MX\Controller.php Line: 4 Function: require

File: C:\xampp\htdocs\Salab\application\third_party\MX\Modules.php Line: 123 Function: include_once

File: C:\xampp\htdocs\Salab\application\modules\acesso\controllers\Acesso.php Line: 3 Function: spl_autoload_call

File: C:\xampp\htdocs\Salab\index.php Line: 315 Function: require_once

3
enable the module in your php.ini file - Ice76
my friend get also this error. - Er CEO Vora Mayur
Can you put your code in this question? So i can identify easily and give best solution. - Er CEO Vora Mayur
And some browser not support mysql_connect() also try mysqli_connect(). - Er CEO Vora Mayur

3 Answers

1
votes

Could you Send the method you using to connect to the database you could try this

 <?php
    //Create Connection
    $con=mysql_connect("localhost","root","");
    //Create Database
    $CreateDb="Create database db2";
    mysql_query($CreateDb,$con);

    //Select Database 
    mysql_Select_db("db2",$con);

   ?>
1
votes

If you are using php7 you should move to mysqli as mysql was deprecated If you are using an earlier version then it seems that the mysql extension is not installed or enabled (note that looking forward you'd better move to mysqli anyway)

0
votes

Check in your php.ini file if you have the line and it's not commented:

extension=php_mysql.dll