Page 1 of 2
Could you suggest me pro/hard Book for Php & Mysqli, PDO?
Posted: Mon Aug 11, 2014 7:37 am
by Kevinphp7
Hello community !
I seriously need your help. As the title says, i would like to suggest me hard/pro
Php Books and
Mysqli or PDO Books.
===> I have already read :
PHP and MySQL Web Development (4th Edition) | Authors : Luke Welling and Laura Thomson but i am not satisfied.
So, i would like to suggest me, updated, relatively
new and
pro Books
- Which Book do you suggest for learning Php ?
- Which Book do you suggest for learning Mysqli or PDO ?
- Any opinions about http://www.amazon.com/Head-First-MySQL- ... 144936358X and http://www.amazon.com/Sams-Teach-Yourse ... and+apache ?
Thank you in advance!
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 7:54 am
by Celauran
What have you learned? What are the gaps in your knowledge that you're trying to fill? Have you looked at
PHP: The Right Way? If you're looking for a book that teaches everything, I'm afraid you're bound to walk away disappointed.
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:18 am
by Kevinphp7
Celauran wrote:What have you learned? What are the gaps in your knowledge that you're trying to fill? Have you looked at
PHP: The Right Way? If you're looking for a book that teaches everything, I'm afraid you're bound to walk away disappointed.
Did i say that i need Mentor ? lol

I think you have not understood what i am asking for.
I never say that i need a teacher or something like that. lmao !
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:19 am
by Celauran
So what are you looking for, then?
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:22 am
by Kevinphp7
Suggestions/Recommendations for pro/hard Php, Mysqli and PDO Books. Nothing else.
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:26 am
by Celauran
Then I'll reiterate my recommendation of
PHP: The Right Way. It's not a print book, but that shouldn't matter. You're not going to find any 'hard' books on MySQLi or PDO, because there's not much to learn.
PDO manual should cover everything you need there.
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:28 am
by Celauran
If you insist on something in print,
PHP Objects, Patterns, and Practice is a great resource. Larry Ullman's
Advanced OOP may also be worth a read.
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:32 am
by Celauran
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 8:59 am
by Kevinphp7
I think David Powers' is a bit old. Matt Zandstra should be useful.
--> Have you any opinion about
http://www.amazon.com/Head-First-MySQL- ... 144936358X and
http://www.amazon.com/Sams-Teach-Yourse ... and+apache ?
Also, do you know any book for Mysqli or PDO ? ( Mysqli . not Mysql )
Thank you for your response and your time !!!

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 9:04 am
by Celauran
I haven't read either of them, but the first appears to be very much a beginners book and the second has received some pretty terrible reviews. I don't know that you'll find much in the way of books relating specifically to either PDO or MySQLi because they're very simple subjects. A chapter or two in a beginners book, sure, but not a book unto themselves.
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 9:13 am
by Kevinphp7
I think that
http://www.amazon.com/PHP-MySQL-Dynamic ... gy_b_img_y and
http://www.amazon.com/PHP-Advanced-Obje ... MK4QDWG9F6 are really good.
So, there is not any book for Mysqli or PDO, because they are too short subjects. Most people say to move from Mysql to Mysqli. And some people say that mysql queries suck. What do you suggest about this ?
Should i continue to learn Mysql, and put in most commands the "i" at the final of commands ? Or should i move to PDO?
I appreciate your help!
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 9:25 am
by Celauran
mysql_ functions have been deprecated. MySQLi is the updated driver, but it's a pain to work with. I find working with PDO much better than working with MySQLi, but you'd do even better implementing an ORM unless your app is exceedingly simple.
Consider straight PDO
Code: Select all
$query = "SELECT * FROM products";
$stmt = $this->pdo->prepare($query);
$exec = $stmt->execute();
$products = $exec ? $stmt->fetchAll() : [];
vs. Eloquent
or for a more complex query:
Code: Select all
$query = "SELECT c.id AS catid, c.name AS catname, s.id AS subcatid, s.name AS subcatname
FROM categories AS c
INNER JOIN subcategories AS s ON c.id = s.category_id";
$stmt = $this->pdo->prepare($query);
$exec = $stmt->execute();
$categories = [];
if ($exec) {
$results = $stmt->fetchAll();
foreach ($results as $result) {
if (!array_key_exists($result->catid, $categories)) {
$categories[$result->catid] = [
'name' => $result->catname,
'subcategories' => [
[
'id' => $result->subcatid,
'name' => $result->subcatname,
],
],
];
} else {
$categories[$result->catid]['subcategories'][] = [
'id' => $result->subcatid,
'name' => $result->subcatname,
];
}
}
}
vs.
Code: Select all
$categories = Category::with('subcategories')->get();
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 9:39 am
by Kevinphp7
How can someone learn PDO if there is not any book for learning ? Is there any site where i can learn PDO

or any useful Paper
And yes, i have seen that most people say that PDO is faster and briefer than Mysqli. The question is, if PDO has the same level of protection with Mysqli or not ? (Forgive me, if this question sucks but i really want to move from Mysql permanently.)
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 9:44 am
by Celauran
Both support prepared statements, which is what you want to protect against SQL injection. The
PDO Book on php.net is really all the reference you'll need. There was a
quick intro on /r/php a while back that may also be of interest to you.
Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO
Posted: Mon Aug 11, 2014 11:05 am
by Kevinphp7
In conclusion, someone needs more time to learn Mysql and code in it than PDO ?
PDO, works great with Apache, right ? And which IDE do you use with PDO ? For examle, i used WampServer (Apache : 2.4.9 MySQL : 5.6.17 PHP : 5.5.12 PHPMyAdmin : 4.1.14 SqlBuddy : 1.3.3 XDebug : 2.2.5 )
Could i use PDO with Wamp or it needs something else?
Thank you !