php - Set up PDO connection without password -
i'm trying connect database, changed database's root password in interest of security. however, in order connect database , use pdo, apparently have pass password in php, not security:
$hsdbc = new pdo('mysql:dbname=hs database;host=127.0.0.1;charset=utf8', 'root','passwordgoeshere'); $hsdbc->setattribute(pdo::attr_emulate_prepares, false); $hsdbc->setattribute(pdo::attr_errmode, pdo::errmode_exception);
am being stupid , because it's php no-one person views actual file able see password, or there way without passing password in file.
people not able go , read files. should safe on place host it. able files if able place when host stuff. should not possible if don't have info there.(which should known you).
this not pdo. mysql , mysqli this
Comments
Post a Comment