How did you learn how to program PHP/MySQL?

Status
Not open for further replies.


Well I have a C++ and javascript background so PHP was easy to pick up on. I used PHP.net for reference.

What I do when I want to learn a new code, I think of something I actually need, lay it out, and start figuring out how to code it in whatever it is I want to learn.
 
Learn another language first, I know it's so 80's but try learning QBASIC. There are some tutorials out forit, just spend a few days playing around with it and making some little worthless programs. Once you know the basics, then php is easy peasy.

Er....no. Just go straight for PHP.
 
There's only one way to learn how to code and that's to have projects that you want to get done. Typically most try outsourcing first and then realize what a pain in the ass coders are and get fed up with them. Then decide they need something done and sit down and force themselves to do it. Usually inspired by someone doing the same thing as them but making a lot of money because they coded a system for it.

At least that was me :D
 
There's only one way to learn how to code and that's to have projects that you want to get done. Typically most try outsourcing first and then realize what a pain in the ass coders are and get fed up with them. Then decide they need something done and sit down and force themselves to do it. Usually inspired by someone doing the same thing as them but making a lot of money because they coded a system for it.

At least that was me :D

Bingo. I hate dealing with outsourced coders.
 
My opinion is you need to take a programming class at least once. It doesn't matter what language, but you need to get the methodology down. Then wen you are interested in coding for the web, PHP, ASP, java, etc, you need to setup a development box at home. Even if it's your main PC, you just need a place to develop and test. (A lot better than tryignn to constantly upload code to your server).

Start out small by downloading some scripts that match you interests (the simpler the bettter) and figure out how they work. Add some of your own code to improve or strip out stuff you don't need. Working with basic scripting and then evolve to mysql. Databases are easy once you work with them for a while but it could be hard if you're trying to learn php and mysql at the same time.

The best advice is already given by Chatmasta. Go with PHP for now and jump right in. once you get the hang of it and code stuff for yourself you'll get better over time. Once you code enough you'll soon start to grow a library of code that you can reuse and start new projects/sites quickly.
 
For me, learning PHP was a real bitch until Smaxor explained some things to me. I don't remember exactly what it was, but something he said made a light bulb go off in my head and things have been a lot easier since.

Another thing that has helped is having a clear idea of something I wanted to accomplish with PHP. Before, it was like "I want to learn PHP, but I don't know what I want to do with it yet." Now, I know what I want to do, have a basic understanding of the language and can figure out the rest with the help of online tools, and the half dozen PHP books on my desk. The two best I've found are "PHP and MySQL - Visual Quickstart" by Larry Ullman, and "Learning PHP 5" from O'Reilly.
 
I've bought books, downloaded ebooks and read websites. I can't seem to get myself to learn the language.

Any tips? How did you guys learn?

A very useful prerequisite is understanding of html. Understand the structure of a basic page.

If you're working on a remote server, make sure you fully understand ftp and your directory structure. Understand why your URLs look one way while your directory structure might be a little different.

Then, learn php WITHOUT any mysql interactions. Understand how php scripting interacts with the html markup. Learn how to interweave snippets of php into an HTML document.

Once that is done, learn how to create a sql table and write a few sql select and insert statements.

Finally, integrate a sql query into your php code.

Some people learn these things faster than others, and some probably will never learn to do it well. If you 'enjoy' learning about it, then you'll probably be OK. The people that never seem to pick up on it always hate it from the start.
 
There's only one way to learn how to code and that's to have projects that you want to get done. Typically most try outsourcing first and then realize what a pain in the ass coders are and get fed up with them. Then decide they need something done and sit down and force themselves to do it. Usually inspired by someone doing the same thing as them but making a lot of money because they coded a system for it.

At least that was me :D

Bingo. Same here.
 
Go for EasyPHP instead of WAMP or XAMPP. Very easy to set up and run, good development enviroment with Apache, PHP and MySQL.
 
learning a language good will help you with future languages you want to learn...most are very similar and they kinda work the same...once you learn one, others will be much easier to learn...
 
Learning PHP

My favorite PHP resources include PeachPit Press: PHP and MySQL, Wrox: Search Engine Optimization with PHP, O'Reilly: PHP Hacks, and Google.

The best way to learn a new programming language, is to start a project and customize tutorials from various resources to pull the project together. I learned PHP by putting together a POS social community nightlife site, but I wrote all the components myself except for PHP BB. But then I modified PHP BB to the point that at least half of the files were changed to some degree. You just have to sit down and do it. I recommend Dreamweaver for your development IDE.
 
I learned it from php.net and the sitepoint forums in the good old days.

All you really need to do is learn what mysql functions are available and start on a project right away. Something simple with a database involved. Then get some feedback on it and improve from that.

I also have the following books:
- Advanced PHP programming
- PHP Architect's guide to php security
- Essential php security.

All recommended, especially the last two if you want to learn about some interesting security concepts. But I guess these books aren't so basic any more.

What's also good to do is checking out open source projects, and you definately want to check out some frameworks to see the different methodologies.

Do learn about object oriented PHP, as it is the cleanest form and allows you to separate things out that would otherwise be duplicated alot.

Edit: I just remembered I used phpfreaks.com alot in my early days, checking out their sample code and what not. I'm not sure if they are still a good reference today though.
 
i haven't ready any other responses, i'll just tell you how i learned...

i started off on my *own* project... i wanted to build a job search site (this was years n' years ago). and you just logically plan out which parts of the site youll build first.. i started with the design.. and then i thought to myself, well.. the signup page would be a good place to start coding wise.. so i built the form, researched on google how to store data in mysql.. etc etc, learn bit by bit to achieve what your project needs..

learning through books really sucks usually, unless the book will take you from the very beginning, to the very end of a project. most books unfortunately just give you separate example by example, which makes it difficult to really learn real world use.
 
Read the basic O Reilley books to get a good idea of how php and mysql works. Try installing a php mysql database such as a PHP forum or a wordpress. Then move on to more advanced php mysql projects.
 
Status
Not open for further replies.