Sabtu, 17 Agustus 2013

PHP Indonesia - Facebook: Koneksi database dengan PDO sangat memudahkan bila...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Start taking a college level music theory class today.

This beginner class is now accessible to aspiring musicians of all ages. Learn all of the basic concepts in an easy to follow manner.
From our sponsors
Koneksi database dengan PDO sangat memudahkan bila...
Aug 17th 2013, 23:33, by Ahmad Ibrahim

Ahmad Ibrahim 11:33pm Aug 17
Koneksi database dengan PDO sangat memudahkan bila mau ganti-ganti database sebagai contoh
// Koneksi Untuk mysql
$dbname='rsp_lavalette';
$connectionString='mysql:host=localhost;dbname='.$dbname;
$username='root';
$password='rvnz-2010';

// Koneksi Untuk Postgre
$dbname='rsp_lavalette';
$connectionString='pgsql:host=localhost;port=5432;dbname='.$dbname;
$username='postgres';
$password='rvnz-2010';

$db = new PDO(
$connectionString,
$username,
$password,
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
$sTable= 'pasien';
$sql = "SELECT * FROM $sTable";
$rows=$db->query($sql);
foreach ($rows as $row) {
print_r($row);
}

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar