Archive for September, 2007

PHP Video Tutorial: PHP Loops

Wednesday, September 26th, 2007

PHP Video Tutorial

Hi,

I’ve released a new video tutorial covering PHP basics. In this video I teach three different loop types in PHP:

  • For Loops
  • While Loops
  • Foreach Loops

The Video: php loops

Thanks,

Stefan Mischook

www.killerphp.com

Video Tutorial: PHP conditionals

Monday, September 24th, 2007

PHP Video Tutorial

The following video teaches the basics of conditional statements in PHP; specifically the ‘if’ statement.

PHP conditionals video tutorial

Again, this video is for beginners to PHP and programming in general.

Note to uber-nerds:

If anyone complains to me that this video is to simple, I might hit you with a theoretical article on how aspects (as in aspect oriented programming) can be used to injects meta-data into your objects, without polluting the model.

:)

… Good old Java.

Stefan

Video Tutorial: Processing forms with PHP part 3.

Monday, September 24th, 2007

PHP Video Tutorial

I just released part 3 on how to process forms with PHP:

Processing forms with PHP – part 3

This video wraps up my introduction to forms and PHP where I also teach a little about functions along the way. It’s about 8 minutes long.
-

This video is geared towards total beginners to PHP so I don’t wanna hear people complain it was too simple.

… Go to my OOP PHP videos if you need something a little more advanced.

Thanks,

Stefan

Cannot load mysql extension error – Video Tutorial How To

Saturday, September 15th, 2007

I recently ran into the following error when trying to launch PhpMyAdmin from the WAMP icon tray menu:

phpMyAdmin – Error
Cannot load mysql extension. Please check your PHP configuration.

What does this mean?

In a nutshell, PHP cannot find the library (mysql.dll – on Windows) it needs to connect to MySQL.

How can you fix this?

  1. Use phpInfo() to find out what php.ini file PHP is using. It’s near the top.
  2. Go into your php.ini and enable the extension that loads the mysql.dll library.
  3. Set your Windows ‘Path’ to point to the directory where the mysql.dll is sitting.
  4. Restart Windows.

The solution (and more details) can be found in this video:

Tip: Try the full-screen mode for the video .. it’s pretty nice.

I hope you find this useful.

Thanks,

Stefan Mischook (All around nerd.)

www.killerphp.com

Installing PHP and MySQL on the Mac with MAMP

Friday, September 14th, 2007

In my beginners php videos, I recommended XAMPP as the way to easily install Apache, PHP, MySQL on a MAC.

Well, I just discovered something called MAMP at:

http://www.mamp.info/en/index.php

This nifty little application allows you to (really easily) install Apache, PHP and MySQL. You are provided with a standard DMG file that you simply drag to your applications folder.

MAMP has a pro ($) and a standard version … all programmers need (to do their development on their local machines,) is the free standard version.

Once installed you can start MAMP up (and thus Apache, MYSQL) as you would any other program … and this is what you get:

Mamp Control Panel

As you can see, you can start and stop the servers and tweak the MAMP settings (example: where Apache looks for web pages … the Apache document root etc).

The MAMP ‘Start Page’:

Like XAMPP, MAMP comes with it’s own ‘Start Page’ where you can access:

  • MySQL password information.
  • phpMyAdmin
  • SQLightManager

The Screenshot:

Mamp Start Page

Dashboard Widget!

But what’s even more cool, is that MAMP comes with a Dashboard widget:

Mamp Dashboard widget

Conclusion:

I am currently using MAMP to do some test on a PHP based CMS (Drupal) and MAMP allowed me to set up my Mac in about 5 minutes … maybe 4.

Stefan Mischook

www.killerphp.com

Object Oriented PHP Tutorial in PDF

Tuesday, September 11th, 2007

php logo

Hi,

I’ve had several people request that the article on object oriented PHP be made into a PDF for offline viewing.

oop in php

Well … here you go: oop php pdf

The PDF also contains links to the accompanying videos.

Thanks,

Stefan Mischook

www.killerphp.com
www.killersites.com

Building Objects in PHP – Part 3

Sunday, September 9th, 2007

PHP Video Tutorial

Hi,

I’ve just released part 3 of my videos on objects in PHP.

In this video, I clarify a point I was trying to make in part 2. In a nutshell, I talk about why it makes sense to keep any page rendering code (HTML and CSS) out of your business logic classes.

.. I cover the details in this video.

Thanks,

Stefan Mischook

www.killerphp.com

Building Objects in PHP – Part 2

Sunday, September 9th, 2007

PHP Video Tutorial

Hi,

I’ve released part 2 of the video: Building Objects in PHP

In this video, we actually use the object we created in Part 1, in our PHP page.

-

I will have another video to clarify and wrap things up covered in Part 1 and Part 2.

Thanks,

Stefan Mischook

New Video: Building Objects in PHP

Friday, September 7th, 2007

PHP Video Tutorial

Hi,

I just released part 1 of my video on building objects in PHP.

This is a hands-on video where I hope the viewer will actually write code along with me. I want to stress that this video (like everything else on this site,) targets beginners .. not old PHP hacks.

… My goal is to make object oriented programming approachable to everyone.

-

Part 2 should be out within a few days.

Thanks,

Stefan Mischook

www.killerphp.com

Why learn OOP in PHP – another take.

Friday, September 7th, 2007

php logo

Why learn OOP in PHP – another take.

For people new to OOP and are comfortable with ‘classic’ procedural php, you may be wondering why should you even bother to learn object oriented concepts … why go through the trouble?

The PHP world:

PHP is moving in an OOP direction. For example, many important PHP extensions like PEAR and Smarty are OO based. So, to really understand and use these frameworks properly, you need to understand object oriented PHP.

The functional/practical advantages:

For smaller projects, using object oriented PHP may be overkill. That said, object oriented PHP really begins to shine as the project becomes more complex, and when you have more than one person doing the programming.

For example:

If you find that you have say 10-20 or more functions and you find that some of the functions are doing similar things … it is time to consider packaging things up into objects and using OOP.

OOP and your career as a programmer:

OOP is the modern way of software development and all the major languages (Java, PERL, PHP, C#, Ruby) use this method of programming. As a software developer/programmer, it only makes sense (in terms of career,) to keep your skills up-to-date.

Besides making you a more valuable PHP coder, understanding OOP in PHP will give you knowledge (OOP knowledge,) that you will be able to take with you into other languages.

… When you learn OOP in PHP, you’ll learn object oriented programming for any OO based language.

You will find with time that creating OOP based PHP projects, will just make your life as a programmer much easier. As an added bonus, soon you will develop your own collection of reusable objects, which you will be able to leverage in other projects.

Finally, You will also find that OOP based PHP is much easier to maintain and update.

OOP Challenges:

OO PHP does present some challenges when you first start out because you’ll need to learn to think about your PHP projects in a different way: you will need to conceptualise the project in terms of objects.

More details …

One common way of starting an object-oriented project is to start by drawing up simple diagrams of your objects. As you begin to work with object diagrams, you will find that they help make developing OOP based PHP projects much easier.

Here are a few tips about drawing object-diagrams:

· Use a paper and pencil
· Draw boxes to represent each object
· In those boxes, list your methods and your properties
· Use arrows and lines between boxes to denote relationships (parent – child) between objects.

So if you have been sitting on the fence waiting to jump into OO PHP, now is as good time as any to get started.

Stefan Mischook

www.killerphp.com
www.killersites.com

Object Oriented PHP Tutorial Updated – Steps 18 – 22

Thursday, September 6th, 2007

php logo

Hi,

I’ve update my beginners tutorial on object oriented PHP adding steps 18-22.

Again, this is a code intensive article where I expect you to follow along with your PHP editors.

PS: if you happen across any errors/typos, please let me know.

More to come.

Thanks,

Stefan Mischook

www.killerphp.com

Top of page  go to top of page