Problem to connect to datebase

For programming and general questions on Zend Framework

Problem to connect to datebase

Postby robe8885 on Thu Feb 01, 2018 12:02 pm

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.
robe8885
 
Posts: 3
Joined: Thu Feb 01, 2018 11:53 am

Re: Problem to connect to datebase

Postby robe8885 on Thu Feb 01, 2018 12:19 pm

If u need more information, please tell me what.
robe8885
 
Posts: 3
Joined: Thu Feb 01, 2018 11:53 am

Re: Problem to connect to datebase

Postby robe8885 on Thu Feb 01, 2018 3:22 pm

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.
robe8885
 
Posts: 3
Joined: Thu Feb 01, 2018 11:53 am

Re: Problem to connect to datebase

Postby kian6526 on Sun Feb 11, 2018 1:26 pm

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
kian6526
 
Posts: 13
Joined: Sun Feb 15, 2015 10:09 am


Return to Zend Framework

Who is online

Users browsing this forum: Google [Bot] and 2 guests