Sponsored Links :
  • What is MySQL?

    If you’re reading this tutorial, there’s a good chance you’ve already gained a reasonable familiarity with PHP programming, and can piece together a simple application with a few lines of code. If not, why not head on over to the PHP Tutorial section for a quick refresher course?

    If you have attained a reasonable understanding of PHP, you’ll be aware of the great potential PHP has for building web-based applications and interactive websites to allow users to add content or contribute to discussions. This interactivity is a major component of many such sites, and the ability of these sites to store and manipulate user data plays a vital role in their success.

    One of the most common technologies used on the internet to store large quantities of data for future retrieval and display is the database system MySQL. MySQL is an example of a database management system (DBMS) which, in laymans terms, means that it has the ability to store and retrieve large amounts of data for whatever use the user sees fit. In our case, for display in our dynamic websites and applications.

    Data Storage for the Masses

    Data storage is a hot topic on the internet today. If you’ve used Google’s GMail application for email, you’ll have seen that they currently offer roughly 7 Gigabytes of storage per person. That’s a lot of space! Other sites, such as Flickr for photography, and Facebook for social networking and chat also require a lot of storage space to allow their users to keep track of the vast amounts of information they upload.

    You might be surprised to know, but the same technology that powers these sites, and keeps them running with millions and millions of hits is the very same technology I’m going to introduce you to here. Yep, that’s right - MySQL is capable enough to support multi-million user websites while at the same time being simple enough to pick up and learn the basics in a short timeframe. What’s more, it’s completely free! Thanks to the wonders of Open Source software, this powerful database tool is available for anyone to download and start using right away. Maybe one day when you become a top notch developer, you could contribute something back to this fantastic community of community-created software!

    MySQL with PHP

    PHP is a scripting language, used to generate web-pages and process information. MySQL is a data storage application, and is used to keep track of vast quantities of data. When you put the two together, you gain the power of PHP to display and alter the data stored within MySQL in whatever way you desire.

    PHP and MySQL are two completely seperate applications. One can happily exist without the other, and it’s even possible to use other programming languages with MySQL (Perl, Java etc.), as well as other database systems with PHP (PostgreSql and others) but the combination of PHP with MySQL is one of the most widely used, and many of the most popular content management systems (such as Wordpress, Drupal and Joomla) cannot function without them.

    The link between PHP and MySQL comes with the use of a database extension to allow PHP to access and modify the data held within the database through the use of special PHP function calls, such as mysql_query() to run a specific query on the database, and mysql_connect() to establish a connection to the database at runtime.

    The proper usage of these functions, and more detail about other MySQL extension functions will be outlined in later sections in this tutorial.

    Please note that all these tutorials assume that you’re using the combination of PHP with MySQL. You’ll still be able to get something out of it if you’re not using PHP, since the majority of the tutorial relies on only a few simple PHP functions, and these will usually have similar equivalents in whatever other language you’re using

Leave a Comment

Want to ask a question about anything in this tutorial? Have you spotted an inaccuracy, or noticed areas for improvement? Fancy just having a chat? Leave your comments below...

Recommended Reading from Amazon.com

Next tutorial
Setting up and Connecting to MySQL with PHP