Welcome Guest, Not a member yet? Register   Sign In
error when trying to config database.php to use PDO
#2

[eluser]Sweden[/eluser]
Hello!
Not sure I can help you, but I had some problems to get it to work aswell, and what I did was that he suggest in the other thread (which I asked stuff in myself).

I set hostname to this
Code:
$db['default']['hostname'] = 'mysql:localhost';

Why he think that its useless to use PDO without prepare/execute is because you gain no extra security, and how I do my queries are like this:

Code:
$sth = $this->db->conn_id->prepare("SELECT * FROM tbl_movies");
$sth->execute(array("Harry%Potter"));
(or you can use bindParam if you prefer that)

Using PDO, you dont have to escape your string when inserting, which is something I like about it.


Messages In This Thread
error when trying to config database.php to use PDO - by El Forum - 06-16-2012, 08:06 PM
error when trying to config database.php to use PDO - by El Forum - 06-17-2012, 09:28 AM
error when trying to config database.php to use PDO - by El Forum - 06-17-2012, 11:46 AM
error when trying to config database.php to use PDO - by El Forum - 06-19-2012, 01:02 AM
error when trying to config database.php to use PDO - by El Forum - 06-20-2012, 05:55 AM
error when trying to config database.php to use PDO - by El Forum - 06-20-2012, 05:56 PM
error when trying to config database.php to use PDO - by El Forum - 08-19-2012, 12:43 AM
error when trying to config database.php to use PDO - by El Forum - 08-19-2012, 12:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB