Could you suggest me pro/hard Book for Php & Mysqli, PDO?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Could you suggest me pro/hard Book for Php & Mysqli, PDO?

Post 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
  1. Which Book do you suggest for learning Php ?
  2. Which Book do you suggest for learning Mysqli or PDO ?
  3. 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!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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.
Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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 :banghead: I think you have not understood what i am asking for. I never say that i need a teacher or something like that. lmao !
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post by Celauran »

So what are you looking for, then?
Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post by Kevinphp7 »

Suggestions/Recommendations for pro/hard Php, Mysqli and PDO Books. Nothing else.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post by Celauran »

Finally, David Powers' PHP Object-Oriented Solutions.
Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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 !!! :)
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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.
Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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

Code: Select all

$products = Product::all();
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();
Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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.)
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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.
Kevinphp7
Forum Newbie
Posts: 10
Joined: Fri Aug 01, 2014 6:05 am

Re: Could you suggest me pro/hard Book for Php & Mysqli, PDO

Post 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 !
Post Reply