Learning PHP / MySQL

Lesli

New member
I know how to install and configure scripts written in PHP. But I'd like to know how to write simpler PHP scripts, start learning the language, and potentially build up to writing smaller apps. I'd like to find a book / site / tutorial series with good step-by-step examples. What would you recommend?

I bought a used copy of Christopher Cosentino's Essential PHP for Web Professionals off of Amazon - it's not good for people who already know the code, and apparently the section on installation on Linux machines is poorly edited; but the books in this series have generally been a good introduction. What else would you recommend - especially when it comes to interfacing properly with a MySQL database?
 
For the most part, I usually use google and do the searches etc. I had looking in the past of taking some online courses with Zend, but never followed through. I think the price tag was in the $800 range, but what they were covering was something I was interested in.

I ended up "figuring it out" on my own through the help of google and users that have posted their information etc - and while my programming WORKS, it could certainly stand to be optimized. :)

O'Riley usually produces some handy books. I know back 10+ years ago their guide to "vi" and shell scripting was beside my computer on a daily basis. These days I actually don't have any book that I open - too much info on google.
 
Web searches are a good source of information once I've learned the basics (especially when I want to find those little tips and tricks that won't be covered in any course or book), but to use HTML equivalents, I've just barely started using DreamWeaver in Design mode. For the initial start, I want something a little more structured than random web searches. (I also don't want to learn any bad / insecure coding habits - and if I pick the wrong sites from which to learn, I might end up doing just that.)

I'm also trying to avoid the $800 pricetag courses. If I were expecting a lot of one-on-one training and teaching, I *might* think of paying that much for a course. However, for this, I don't require a private tutor - just some structured initial work to get me grounded in the basics, and then I can use web searches and / or read bitzenpiecen catch as catch can.
 
In that case, the O'Riley books are ideal. Also, there's a few books being produced by Adobe (also availble as eBooks I believe) that cover the Dreamweaver software and the various aspects. I know that they have their overview book, but they also have specific parts such as connection php to mysql, validating cookies and doing screen stripping importing the data as XML and repackaging it on your site.

Much of it however is not in a single overview book :( That was something I struggled with years ago in Assembly. It seemed that each book produced only covered certain aspects, and nothing fit exactly what I needed. Even Network Security books are 50/50 at best.

A few good places that I've used;

www.communitymx.com
php.about.com
www.phpbuilder.com
www.oreilly.com

phpbuilder.com seems to be a site that I'm always finding and learning through.
 
Thanks, Conor. I don't really care about learning DW - I learned to code HTML by hand in 1993, that's still my preferred method of creating or editing HTML and CSS. I was just using that as an example.

O'Reilly's quickref books are favorites of mine - straightfoward, simple, just-the-facts, good examples. I've got quite a few of them (CSS, JavaScript, even PHP and MySQL). Their books, though, tend to be a bit overkill for the initial learning kickoff. There's lots of verbiage that gets in the way of someone who learns best by doing, not by reading. They're fine for research. Not so great for hands-on learning - and since hands-on learning is what I want, I'd rather spend my money on a book that teaches me the basics in a fast, simple-to-learn method - THEN start doing my own research.

I may check into those sites once I've "learned how to crawl", essentially. I've also bookmarked a few other resource-sites, always intending to use them once I'd gotten a grounding in the basics. (Which keeps getting put off and put off and put off...)
 
Yeah, I hear ya. That's one of the reasons I can't stand reading books myself ;) Usually I'm doing problem solving and script bashing to make a final product. Starting from scratch always bothers me ;)

Fingers crossed for you. Let me know what you find you.
 
The best way I have found to learn a new computer language is to first identify the problem you want to solve and then try and write the code to do it. Once you have something that works, even if it is rough, find a friend or mentor that knows the language and ask them what they would do differently or improve.

I'd be glad to answer questions for people trying to learn PHP as I have time. Just send me a PM on the forums.
 
having a mentor is deffently an advantage and does help when you have particualr issues, there are numerous sites that are devoted to helping users with languages like php, the pear libary is a good example of a place to start with scripts that are maintained at a high standard to work with and build upon

also as far as enviroments go there are scripts such as code ignitor that can be installed on a webserver to allow you to creat Object Orrientated scripts easily
 
I'm very familiar with Code Igniter and Ellis Labs (the people behind Code Igniter). However, I want to be able to do more than just use a framework - though it's an extremely valuable tool, I want to know why using one solution is best in *this* situation, and maybe not optimal in *that* situation.
 
There are probably two areas you should be looking into. One would be learning PHP in depth and the other is software architecture and patterns. If you want to know why one framework might be better suited for your needs than another, then understanding patterns is important.

Design Patterns is a very good start for learning about software architecture independent of language.
 
Some of the best methods I've found is to learn by doing, and read as much as you can.

I can suggest the book the PHP Bible. The book is 4 inches thick and covers darn near everything you could ever forget.

Start small. Learn basic things first, and learn more advanced techniques as you need them.

Like:

"Gee I'd really like to get php to look in a folder and display a random image from that folder"
That is your simple goal. Once you;ve accomplished it, you may find yourself saying "Hmmmm it would be nice if I could make it display smaller but uniform with the rest of the thumbnails" then that would be your next simple goal. Together however you have a nice more advanced project.

Learning like that helps you learn quickly. I learned VB.NET in about 2 weeks doing that, and relentlessly reading books. Two months later I had completed a business class application.
 
Some of the best methods I've found is to learn by doing, and read as much as you can.

I can suggest the book the PHP Bible. The book is 4 inches thick and covers darn near everything you could ever forget.

Start small. Learn basic things first, and learn more advanced techniques as you need them.

Like:

"Gee I'd really like to get php to look in a folder and display a random image from that folder"
That is your simple goal. Once you;ve accomplished it, you may find yourself saying "Hmmmm it would be nice if I could make it display smaller but uniform with the rest of the thumbnails" then that would be your next simple goal. Together however you have a nice more advanced project.

Learning like that helps you learn quickly. I learned VB.NET in about 2 weeks doing that, and relentlessly reading books. Two months later I had completed a business class application.

Many things I've learned to do simply by doing just that. Thinking "I want to do ____" and in most cases a google query usually leads me to "the how" on php.net.
 
Many things I've learned to do simply by doing just that. Thinking "I want to do ____" and in most cases a google query usually leads me to "the how" on php.net.

That's why I like the "_____ for Web Professionals" series: it walks you through an actual task, start to finish. Once I've got everything in context and have an idea of what steps a project might take, I can start with the rest of the learning process.

Otherwise...right now, I have no projects that require PHP. I want to know some basic PHP so that if I end up needing to tweak some scripts, or write an extension that a dev client may want for EE, I'll at least know how to crawl - and can start researching intelligently about how to do X rather than just flying blind and either learning overly much on the client's time (very bad), or making newbie mistakes because I'm in a hurry.

PHP.net is a good resource / quickref...if you've already got some knowledge of PHP and how it works. I've found that it isn't so great for those of us just starting out. (Much like I would not recommend W3Schools.com as the sole resource for someone just learning HTML. It's a good quick reference - especially for brushing up on the syntax of a tag you don't use very often; but not the best teaching tool.)
 
Well as always, I love helping people out, so if you need any help let me know. A co-worker once showed me much of what I know with MySQL & PHP, so I owe it to pay forward to some degree.

learning overly much on the client's time (very bad)
Maybe it's just me, but I NEVER learn on a client's time. Very bad IMO. If I come across an issue that I have to research I stop the clock and don't start it until I'm back "accomplishing" something to do with their project.

This concerns me, and I wonder how many others learn on their client's time.
 
I stop the clock and don't start it until I'm back "accomplishing" something to do with their project.
I adopt a similar approach when doing websites or scripts, as designers or even coders/programmers can’t be expected to know everything and if charging clients while you’re learning is an approach you take, its going to be a shock on the client when they see the bill, let alone on your reputation.

The internet is a good tool for finding solutions to problems but there are so many solutions to one problem these days that it is very difficult for anyone learning a language to decide which one to adopt and a large number of the examples or code shown will only work under certain circumstance. And those learning the language often adapt scripts and later notice the consequence.

Trial an error is the best way to learn with any language, as long as it’s with your own time and not that of your employer or client.
 
Last edited:
Troubleshooting a new routine? Writing a new subroutine? Configuring a script differently than you've done previously, and / or using a feature you've known about but haven't previously implemented (and thus reading the API to figure out the configuration options)? All of that falls under the category of "learning on the client's time."

Learning HTML, CSS, PHP, Photoshop, et cetera from ground zero? That's stuff one should learn on one's own time. Hence my desire to learing PHP: I haven't needed it previously aside from installing some scripts; but I could, in the next year, be in situations where more in-depth knowledge of PHP is necessary. I'd rather not wait until the last second to get a decent overall grasp of concepts and programming. It's then more difficult to separate out my learning-time from client- or project-specific learning time.

And yes, for the above-mentioned smaller stuff, I charge any development clients for time spent researching and configuring things for their specific project, if it's not something I have to go out and research. Legal professionals do the same thing when they have to research points of law, gather information and evidence. The client is billed for that time. There's honest and dishonest ways to bill a client for your time spent troubleshooting and researching specifically for their project - much as there are both honest and dishonest practitioners in just about any profession.
 
I adopt a similar approach when doing websites or scripts, as designers or even coders/programmers can’t be expected to know everything and if charging clients while you’re learning is an approach you take, its going to be a shock on the client when they see the bill, let alone on your reputation.

The internet is a good tool for finding solutions to problems but there are so many solutions to one problem these days that it is very difficult for anyone learning a language to decide which one to adopt and a large number of the examples or code shown will only work under certain circumstance. And those learning the language often adapt scripts and later notice the consequence.

Trial an error is the best way to learn with any language, as long as it’s with your own time and not that of your employer or client.

I personally won't take a project unless I know EXACTLY what steps I need to take to accomplish the desired end result. There are of course circumstances where workarounds & alternative methods are needed, but in such cases I deduct any "wasted time" from the total time spent on the particular task.

If extensive research is needed on an API for example, the "potential" client is notified before hand and arrangements are made. This happens very rarely as most come to me knowing what they want and asking what they need.
 
If I need a script that has to work with X application, I see no reason why I should not be billed for the time the programmer must take to familiarize himself with that specific application. I can't expect him to know all about the hundreds of applications out there, or do this kind of research on his own time. Now, if I'm lucky enough, or make this a requirement, I might find a programmer who's already done that research as part of other jobs he had, but I can at the same time expect this to lead to a very long search for the "right" programmer.

Just my personal take on this of course.
 
Back
Top