note 99659 added to pdo.construct

From: Date: Sun, 29 Aug 2010 18:14:57 +0000
Subject: note 99659 added to pdo.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-172147@lists.php.net to get a copy of this message
You have to use the following option "MYSQL_ATTR_READ_DEFAULT_FILE" to prevent someone from attacking your system by SQL Injection. <?php $dsn = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME; $dbh = new PDO( $dsn, DB_USER, DB_PASS, array( PDO::MYSQL_ATTR_READ_DEFAULT_FILE => '/etc/my.cnf' ) ); $dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 219.179.244.39 ---- Manual Page -- http://www.php.net/manual/en/pdo.construct.php Edit -- https://master.php.net/note/edit/99659 Del: integrated -- https://master.php.net/note/delete/99659/integrated Del: useless -- https://master.php.net/note/delete/99659/useless Del: bad code -- https://master.php.net/note/delete/99659/bad+code Del: spam -- https://master.php.net/note/delete/99659/spam Del: non-english -- https://master.php.net/note/delete/99659/non-english Del: in docs -- https://master.php.net/note/delete/99659/in+docs Del: other reasons-- https://master.php.net/note/delete/99659 Reject -- https://master.php.net/note/reject/99659 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#172147) next »