Monday, 19 August 2013

PDO replacing mysqli

PDO replacing mysqli

I'm convinced that I need to migrate to PDO and am working my way through.
I have two questions so far...
(1) Is is always appropriate to use a prepared statement? What if I simply
want to list a set or records from a table and there will only be one
query on that table? Doesn't a prepared statement slow things down for the
first query?
(2) Let's say I have a table with 10 fields. Can I declare a class that
has only six of those fields and then use PDO::FETCH_CLASS, "foo" where
"foo" is my abbreviated class?

No comments:

Post a Comment