Page 1 of 1

Problem to connect to datebase

Posted: Thu Feb 01, 2018 12:02 pm
by robe8885
Hi,
first of all sorry for my english,
i have a problem with connecting to datebase on webhost.
When i trying to connect with MySqli or PDO i get message
An error occurred
An error occurred during execution; please try again later.
No Exception available
i can't even figure out where the problem is.
trying to use PDO with this settings:
'db' => array(
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=atrakcje_krakowa; host=localhost',
'user' => 'atrakcje_krakowa',
'password' => '*******',
'port' => '3306'
),
or even in index action when i try mysqli connect
$conn = new mysqli($servername, $username, $password, $dbname, 3306);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
i get error
An error occurred
An error occurred during execution; please try again later.
No Exception available
Without connecting to datebase everything working fine.
If I'm working on php7.1, on localhost with xampp i have no problems to connecting to datebase,
My webhosting admin enable a PDO in server, and told me that i should have no problem to connect.
Could u help me?
Regards.

Framework version 2.6.

Re: Problem to connect to datebase

Posted: Thu Feb 01, 2018 12:19 pm
by robe8885
If u need more information, please tell me what.

Re: Problem to connect to datebase

Posted: Thu Feb 01, 2018 3:22 pm
by robe8885
I don't know how to edit posts here.
I checked and i can connect to my web database from my local apache server on xampp, but still can't from webhost server.

Re: Problem to connect to datebase

Posted: Sun Feb 11, 2018 1:26 pm
by kian6526
Where did you put those data to connect to database?
put them in autoload/global.php then check if you can connect, also autoload/local.php and check again.
Also try config.module.php or Module.php files too,
I work with wamp, and we have PDO extension to be enabled so that we will able to use PDO driver, If XAMP
is the same way, check the related PDO extension is enabled.
Kian William