PDO getAttribute warning

Discuss everything related to PHP Shopping Cart. All versions. Any questions related to the PHP Shopping Cart developing or using should be posted to this forum.

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: PDO getAttribute warning

Postby ne_moj » Sep 28th, '16, 07:52

Hello paragate

We are very grateful for your work

The MVC Framework to connect to the database only using PDO is why the example with "$pdo->query('select version()')->fetchColumn();" fits perfectly. We just use it. The example you gave above, it makes sense to use if the database connection is used not PDO (eg uHotelBooking during installation using this approach).

Regards

paragate
Master
Master
Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

Re: PDO getAttribute warning

Postby paragate » Oct 7th, '16, 08:17

My thoughts was on the installation to choose database (mysql, sqlite3) to have the ability to work also on sqlite3 together with apphp framework,
using Apple Developer Program for mobile apps, there are the ability to use php together
with flashbuilder, Xcode.

ne_moj
Master
Master
Posts: 243
Joined: Jan 1st, '16, 14:11

Re: PDO getAttribute warning

Postby ne_moj » Oct 13th, '16, 09:40

Hello Henrik

As far as I know PDO allows you to connect and work with sqlite3 database.
It would also be interesting to learn about the progress in the development of a apphp framework.

Regards Sergey

mdony
Newbie
Newbie
Posts: 6
Joined: May 28th, '17, 04:42

Re: PDO getAttribute warning

Postby mdony » Jun 4th, '17, 13:47

Dear All
Is it Possible to manually connect to database , inside the codes of a method in orders.php

........................
$dateTimeFormat = Bootstrap::init()->getSettings()->datetime_format;
$currencyName = $order->currency;
if(!empty($customer) && $customer->notifications){
// Send email

//manually connect to database
$dbHost = "info.dev";
$dbUser = "root";
$dbPass = "xxxxxxxx";
$dbName = "shopdb";
$pdo = new PDO('mysql:host='.$dbHost.';dbname='.$dbName, $dbUser, $dbPass);
// and the perform direct query to tables to update fields


if ($orderInfo['pending_reason'] !='') {
$RealStatus='Pending'.' ('.$orderInfo['pending_reason'].')';
}
else $RealStatus=$status;
$order->email_sent = (bool)Website::sendEmailByTemplate(
$customer->email,
'shoppingcart_success_order',
$customer->language_code,
array(
.....................

administrator
Site Admin
Site Admin
Posts: 5992
Joined: Jan 7th, '09, 23:18
Contact:

Re: PDO getAttribute warning

Postby administrator » Jun 5th, '17, 05:38

Sure, use following:

$params = array(
'dbDriver' => '',
'dbHost' => '',
'dbName' => '',
'dbUser' => '',
'dbPassword' => ''
);

$db = CDatabase::init($params);
$db->customQuery('SELECT.........');
or
$db->customExec('UPDATE.........');

mdony
Newbie
Newbie
Posts: 6
Joined: May 28th, '17, 04:42

Re: PDO getAttribute warning

Postby mdony » Jun 8th, '17, 02:04

Thanks


Return to “ApPHP Shopping Cart Talk {developers/users}”