PHP, MySQL and SQL

Introduction
This article is by no means an in depth guide to using PHP and MySQL. In fact, this area is so big that we’re not even going to tell you how to build your first script.
What we are going to tell you is where you can get good, reliable information, advice, and support (which was almost as difficult to find as PHP and MySQL was to learn) and give you a bit of general knowledge on the subject at the same time.
As most of this article is based on OUR past experiences with PHP and MySQL, we will mainly be talking about MySQL when it’s running on a Linux system (not Microsoft and MSQL).
What is MySQL and SQL
MySQL is an Open Source relational database management system (RDBMS) that uses Structured Query Language (SQL). If you’ve never heard of either of these, don’t worry, your definitely not alone.
In English, MySQL is a server-side program (which means it is installed on a server, not onto your computer) where you can store your databases and access them via the internet. SQL is the language that is used to build the databases and also query (ask questions) the data to find the information you need. So just to recap: SQL is the code that is used to build the database content and query the data (content) in the database. MySQL is the application where the database is actually stored (which is on a server, just as you have Microsoft Access on yours – if you are in to that sort of thing). Are you still following…good, because just to make matters more complicated there’s another program that we’re going to talk about. MySQL Front is a ‘front end graphical interface’, which is basically here to make our lives a lot easier. To build a database and return results in MySQL, you have to use the programming language SQL (as mentioned above) which is not only difficult to learn, it can be VERY time consuming as well. MySQL Front allows us to build databases visually (as apposed to in pure SQL code in, say, Notepad) very much like you would if you were using Microsoft Access. A good place to start would be to get MySQL Front. It’s free and only takes a few minutes to download. The only problem with MySQL Front is that it has virtually no instructions and very little support, so if you have no previous experience with databases it would be advisable to spend some time on Microsoft Access (or a similar program) and familiarize yourself with the ins and outs of database design. Also ‘ Databases with MySQL‘ by Neil Matthew and Richard Stones of the ‘Programmer to Programmer’ series is worth a read (although it doesn’t cover MySQL Front, but this is not a real problem). If you’re interested in reading up on SQL, give ‘SAMS teach yourself SQL in 10 Minutes‘ by Ben Forta a read.
What is PHP?
PHP (short for ‘PHP: Hypertext Preprocessor’) is a server side scripting language that can be written into your HTML scripts and used to create dynamic web pages. It’s probably easier to explain with an example. When you go onto your ISP (internet service provider) to check your e-mails, you have to type in your e-mail address and your password. Providing you get them right, the next page will say “welcome ‘your name’” and give you access to your e-mail account. This is a dynamic website and it has just used PHP to ‘personalise’ that page. PHP has lots of great uses but one of its most powerful attributes is its ability to return information that is relative to what has been inputted. This can allow us to build on-line forms, search engines, guest books, even graphics, and if you must, hit counters and many, many more things. Unfortunately, PHP isn’t an easy language to pick up, although there is a lot of support both online and in the book stores. One site that is especially good is PHP Builder which has lots of articles and hundreds of questions, answers and scripts.
PHP and MySQL
So I suppose you’re wondering why these two languages keep getting mentioned in the same breath. Well, here you go. MySQL can be used to hold the data that PHP will fetch and display ‘dynamically’ to the user. Going back to the e-mails example, it was PHP that shows you the “welcome ‘your name’” part but where did it get your name from? You got it, dynamically (‘on the fly’) from a MySQL database. Using PHP and MySQL together can be a very powerful tool and could revolutionise your web site if you have the time, patience, and motivation to learn it (or at least parts of it). A great place to start is to have a look at the guide MySQL which is very easy to read and walks you through PHP and MySQL at a gentle pace. Also worth mentioning is ‘SAMS Teach yourself PHP in 24 hours‘ by Matt Zandstra, which takes you from your first script, to using PHP with MySQL, right up to some amazingly complex programming (I bet you can’t wait).
Building a PHP/MySQL Search Engine
To anyone who has been learning PHP and MySQL for a while, it probably doesn’t seem like brain surgery, but for the average person, it’s a LOT of hard work. One way around this is by using a program like the ‘ZOOM web site search engine’. This is a free piece of software that provides you with all the different coding you’ ll need to build a fu lly working search engine. If everything goes smoothly, it should take you no more than an hour to have it searching your site and giving you the sort of results you want to see. If you’ve not got the time to learn PHP in much detail and you need a search engine for your site then this is definitely a great way to go.
Zoom download.
Some Useful Links
| PHP | Lots of PHP advice and short script – The Scripts |
| MySQL | The home of MySQL – MySQL |
| PHP | PHP scripts and programs – Hot Scripts |
| PHP | A collection of tutorials, small scripts and complete PHP programs – PHP Wizard |
| PHP | You guessed it! Plenty more scripts here – PHP Script Centre |
| PHP | A very big support forum and plenty of PHP scripts – PHP Builder |
| PHP | News, discussions, FAQs, free scripts and much, much more – PHP Nuke |
| PHP | This site offers both free and commercial PHP scripts – PHP Script Centre |
| MySQL Front | Download MySQL Front from here – MySQL Front |


