topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 11, 2024, 2:26 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Good book to learn PHP?  (Read 7609 times)

highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
    • View Profile
    • Donate to Member
Good book to learn PHP?
« on: October 25, 2011, 02:06 AM »
Hi,

I never learned a programming language before so I need something that doesn't require any previous knowledge.

Can you recommend any books that you've used yourself (I know there are a lot of resources available on the web but I prefer a good book)?

Tia,
highend

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,859
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #1 on: October 25, 2011, 08:56 AM »
+1!

I'd be interested too. I've really got to start cracking the books on pHp soon. Are O'Reily's "animal cover" books still the best bet?
 :)

mahesh2k

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,426
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #2 on: October 25, 2011, 09:22 AM »
Most of the "Dummies" and "O'reilly" titles waste a lot of book space on things like - variables, loops, math manipulation and typical time wasting stuff which is common among all the programming languages. Many books don't teach you how to make web apps or use work with database, libs and other stuff. I suggest starting with W3schools and then think of some project and then create a blog or diary that keeps track of  your learning. This is my way of learning stuff. You'll learn php or any other language much quickly this way than from books which hardly teaches you any real world stuff. There are some php tuts and snippets on the web which makes learning easy. Earlier cut and paste or band-aid learning approach wasn't used to work but considering the speed at which gigs are arriving on freelance and other job sites, books for programming languages hardly teach you anything related to real world stuff.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #3 on: October 25, 2011, 05:00 PM »
Most of the "Dummies" and "O'reilly" titles waste a lot of book space on things like - variables, loops, math manipulation and typical time wasting stuff which is common among all the programming languages. Many books don't teach you how to make web apps or use work with database, libs and other stuff. I suggest starting with W3schools and then think of some project and then create a blog or diary that keeps track of  your learning. This is my way of learning stuff. You'll learn php or any other language much quickly this way than from books which hardly teaches you any real world stuff. There are some php tuts and snippets on the web which makes learning easy. Earlier cut and paste or band-aid learning approach wasn't used to work but considering the speed at which gigs are arriving on freelance and other job sites, books for programming languages hardly teach you anything related to real world stuff.

That tactic works fine for your 2nd programming language...But not so well on the first. I picked up PHP on the fly using the baptism-by-fire method of which you speak. But I already had a C/C++ base to work from which made it much easier.

One of the smartest things my old supervisor ever said to me was: Sometimes we forget what we know. Because we're so distanced from the initial confusion that we sometimes get frustrated by people not grasping ("basic") concepts that we now take for granted.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Good book to learn PHP?
« Reply #4 on: October 25, 2011, 08:11 PM »
There are some php tuts and snippets on the web which makes learning easy. Earlier cut and paste or band-aid learning approach wasn't used to work but considering the speed at which gigs are arriving on freelance and other job sites, books for programming languages hardly teach you anything related to real world stuff.
...and if you don't have previous PHP experience, you have no good way to separate the wheat from the chaff, and you'll end up with the crappy ad-hoc duct-tape 'programming' which has given PHP an even worse name that it deserves. It's fine that small snippets elides error handling concerns, but then people go and copy/paste stuff into production environments... *facepalm*

Can't help with a decent PHP book since I haven't read any. But a few pieces of advice I can give are:

1) if you decide to go by web tutorials, be sure you try to understand everything a piece of code does before even considering using it in production. This also means reading up on the library functions used, including user comments since that's where stuff like security implications is usually discussed.
2) never construct SQL statements with string concatenation, and be sure to always use bound parameters.
3) don't depend directly on mysql/whatever, use a database abstraction library.
4) once you understand the basics, find framework(s) instead of re-inventing the wheel. Get stuff done faster, and without making the same security mistakes that a zillion others have made before you.
- carpe noctem

mahesh2k

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,426
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #5 on: October 26, 2011, 07:16 AM »
If they're charging more than 10$ for a particular language book and going to fill up half of the space with gibberish text that covers (loops, variables and manipulators) and that too with less code, then i have to say that it's time waster and IMO - 'band-aid approach' programming is way better than this gibberish text approach. I don't care if the book is from herb stutter or Herbert schildt or some another popular guy, if that book lacks in example code and only covers gibberish text,i can't help but ignoring it. I have noticed this with many books- like Oreilly, dummies and manning.

Correct me if i'm wrong here, i think learning only one language with dedication (that too any one of your choice) and then moving onto second language on your own without using these books gives much sane feeling to mind. Web tutorials and stackoverflow keeps you in much comfortable position for second language than these books.

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,859
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #6 on: October 26, 2011, 07:42 AM »
I took a look at the suggested W3schools.com website.

I think what's there will fit the bill as a decent 'starter book.' Or it will for me at least since I do program. A little. Sorta.   :)
« Last Edit: October 26, 2011, 07:49 AM by 40hz »

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #7 on: October 26, 2011, 11:36 AM »
Correct me if i'm wrong here, i think learning only one language with dedication (that too any one of your choice) and then moving onto second language on your own without using these books gives much sane feeling to mind. Web tutorials and stackoverflow keeps you in much comfortable position for second language than these books.

I understand where you're coming from, but... If one hasn't at least been dunked in one of these babble-text books, they're not going to be able to understand what they're reading at places like StackOverflow.

char szOne[] = "1"; // is a string. and that string is 1. But you can't add anything to it because it's not the right type of data to do math stuff with.

Bloody obvious and idiot simple? ...Yes. To us perhaps. But to some poor bastard that doesn't know a char, from an int, from an array ... Well... They need time to soak in the (babble-text) shallow end before they can properly form a question for the purpose of getting an applicable answer.

I've got a copy of Sam's Teach Yourself C++ in 24 hours, it came with the copy of Borland's C++ v4.52 that I got from the Staples discount bin for $10. Now while Sam - for the most part - was completely full of shit (on the 24 hour part). The book has come in handy from time to time when I was having a thick moment and needed a really (really...) simple explanation using (very) short words... :)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Good book to learn PHP?
« Reply #8 on: October 26, 2011, 02:15 PM »
If they're charging more than 10$ for a particular language book and going to fill up half of the space with gibberish text that covers (loops, variables and manipulators) and that too with less code, then i have to say that it's time waster
For an introductory book on a language, teaching the basics is warranted. If you already have some language knowledge, you're likely better off going for an intermediate level book instead, unless it's a paradigm you haven't worked with before (if I were to tackle LISP, I'd go for a beginner's book :)).

and IMO - 'band-aid approach' programming is way better than this gibberish text approach.
Page up and page down of dead code listings doesn't help anybody (see "Virtual Machine Design and Implementation in C/C++" for an example of a pretty crappy book that has plenty of code). Sure, you do need some amount of code snippets to get the feel for a language, and you need an introduction to the major API areas.

But instead of dozens of code snippet and trying to cover every API, it's far more important to teach the idioms of the language, how the parts go effectivey together. The reasoning behind using one approach over another. For that to work, you need both code and text... and this the kind of stuff Sutter and Meyers are pretty darn good at doing.

Correct me if i'm wrong here, i think learning only one language with dedication (that too any one of your choice) and then moving onto second language on your own without using these books gives much sane feeling to mind. Web tutorials and stackoverflow keeps you in much comfortable position for second language than these books.
Dedication is definitely important, and so is keeping up with StackOverflow, blogs, and other resources. But IMHO you don't properly learn a second language effectively&efficiently just from those resources - you'll be writing your-first-language idions in the new-language-syntax.

You need (good!) books or lot of practical experience (doing real-life projects with people who are good at the language) to properly learn a new language. Some people might argue that you can just take a look at some existing open-source projects, but those are usually badly documented and commented... and even if those are well-done, you'd really want "annotated sources" which people just don't do.

But of course I'm speaking from the mindset of wanting to learn a new language well, not just being able to pick it up over a weekend in order to take a job offer and deliver sloppy hackjobs :P

I've got a copy of Sam's Teach Yourself C++ in 24 hours, it came with the copy of Borland's C++ v4.52 that I got from the Staples discount bin for $10. Now while Sam - for the most part - was completely full of shit (on the 24 hour part). The book has come in handy from time to time when I was having a thick moment and needed a really (really...) simple explanation using (very) short words... :)
IMHO no beginner should touch the "Teach yourself whatever in N timeunits" books. They might be appropriate for experienced developers who need to get a quick overview of some language and some ideas of topics to investigate further... but probably these days online resources would be better. At least the teach-yourself-X-in-Y books I've seen have been bloody horrible :)

FWIW, the kind of books I find valuable is stuff like Scott Meyers' "Effective C++", Herb Sutters "Exceptional C++". To some degree Bill Wagner's "Effective C#", and definitely Jon Skeet's "C# In Depth".  Those aren't beginner books, they're about using languages... welll... effectively.

But I digress.

- carpe noctem

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,294
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #9 on: October 27, 2011, 01:08 AM »
There's a perceived dearth of titles here, methinks.

I was using VB/Access/SQL Server/ASP pages for years before I found PHP/MySQL.  I found three (3) books to be invaluable:  PHP Developer's Cookbook, PHP and MySQL Web Development, and PHP/MySQL Database Applications.  (Yell if you want the ISBNs.)  OK, I had a lot of experience with databases - PCFile+, dBase III+, Borland Paradox, Oracle, DB2 as well as appropriate scripting languages for each so I couldn't be considered a novice.

However.

I recommended those same three (3) books to a friend of mine who had no more experience than using MS Excel at his former position.  He was trying to build a Web presence and order system for a niche jewelry business he had established locally.  With those three (3) books and an occasional teleconference, he did so.  He's since built two (2) other business Web sites and is currently close to completing a third.  Whatever might be said, he learned from those three (3) manuals.  They are extremely old, maybe even out of print, but what they taught him was, for all practical purposes, timeless.  I still crack 'em open from time to time when looking for a simpler way to do something that I've made overly complicated.

kyrathaba

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #10 on: October 29, 2011, 09:50 AM »
Welling and Thomson's PHP and MYSQL Web Development, 4th Edition

highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
    • View Profile
    • Donate to Member
Re: Good book to learn PHP?
« Reply #11 on: October 30, 2011, 04:42 PM »
Thanks guys, there is some interesting discussion going on here :)

I've just ordered PHP and MYSQL Web Development, 4th Edition and the PHP Developer's Cookbook. Should be enough for a good start :)

Regards,
Highend

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Good book to learn PHP?
« Reply #12 on: October 31, 2011, 09:19 AM »
I've just ordered PHP and MYSQL Web Development, 4th Edition and the PHP Developer's Cookbook.


great choices.  :up: