Others ideas

You may be interested in the posts below.
Online by J&S Code

“pre_get_posts” is a WordPress hook that allows you to modify the current query. Just a quick reminder: when you’re visiting any page of a WordPress install, the system creates a query that depends on the url you’re visiting. This is...

Online by J&S Code

The WordPress search function is much maligned and there are numerous plugins available to add enhancements but they don’t always provide what you want, especially if you are trying to build a secondary search engine that has specific requirements. (more…)

Online by J&S Code

Organizing your content is one of the core features of a content-management system like WordPress. As such, it creates what are called “taxonomies” to help you keep your content easy to find for both your and your visitors. Today we’re...

Online by J&S Code

What seems like one of the most complicated bits of functionality in WordPress is adding meta boxes to the post editing screen. This complexity only grows as more and more tutorials are written on the process with weird loops and...

Online by J&S Code

One of the reasons WordPress powers 27% of the Internet is that it’s an incredibly flexible content management system. We all know about the standard Pages and Blog Posts that you can create easily with WordPress, but what about when...

Online by J&S Code

WordPress uses WP_Date_Query class for generating SQL WHERE clauses to filter queries by date. We worked very hard to build an easy-to-use tool to help developers generate multiple date queries. Introducing our new WP_Date_Query Generator. (more…)

Online by J&S Code

WordPress allows us to filter data by custom fields. The WP_Meta_Query class is used to generate SQL WHERE clauses to filter queries by meta fields. Now after we announced our WP_Date_Query Generator, the next natural move was to let you easily create advanced meta...

Online by J&S Code

In this third part of our series, after presenting the WP_Meta_Query and the WP_Date_Query Generators, we are introducing the WP_Tax_Query Generator which allows you to filter queries by taxonomies. (more…)

Online by J&S Code

WordPress provides us with a wonderful API for managing options. Options are ridiculously simple: they each have a name and a value and are stored in the WordPress database – in the options table – for safe keeping. Options can...

For many people, the main reason for learning a scripting language like PHP is because of the interaction with databases it can offer. In this tutorial I will show you how to use PHP and the MySQL database to store information on the web and include it into your website. Before you read this tutorial you should have at least a basic knowledge of how to use PHP.

It is actually surprising how useful a database can be when used with a website. There are a huge variety of things you can do when you interact the two, from displaying simple lists to running a complete website from a database. Some examples of PHP and MySQL being used together are:

  • Banner Rotation. On this site, where each banner is, a PHP script is called. This opens a database and picks a random banner from it to show the visitor. It also counts the number of times the banner has been viewed and could, with a few changes, track clicks too. To add, change or edit the banners all I have to do is change the database and the script will pick the correct banners for all the pages on the site.
  • Forums. Hundreds of forums (message boards) on the internet are run using PHP and MySQL. These are much more efficient than other systems that create a page for each message and offer a wide variety of options. All the pages in the forum can be updated by changing one script.
  • Databases. One quite obvious example is sites which get all there information from a database. For example Script Avenue is run by a few scripts, which gain all their information from a large database. All the different script categories can be accessed in one script by just changing the URL to access a different part of the database.
  • Websites. If you have a large website and you want to change the design it can take a very long time to update and upload all the pages. With PHP and MySQL your whole website could be just one or two PHP scripts. These would access a MySQL database to get the information for the pages. To update the website’s design you would just have to change one page.

You only really need three things to run PHP scripts which access MySQL databases. Firstly, you will, of course, need a webserver. This can either be on a computer of your own or on a web host. Any web server software should work with PHP and MySQL but the best to use is Apache, which is free.

PHP also needs to be installed on the server. If it is not already installed you can install it (or ask your web host to install it). It can be downloaded from PHP.net and is also free. If you are not sure if you have PHP installed I will show you a way to check it later.

Finally, you will also require MySQL. This is the actual database software. You can also use most other types of database (SQL, Oracle etc.) but as this is a PHP/MySQL tutorial I will deal just now with the MySQL database (although the commands used here will also work with SQL databases). As with the other software you need, MySQL is free and can be downloaded from the MySQL homepage. If you are not sure if you have MySQL installed, I will show you how to check later.

If you cannot install (or your web host won’t allow) PHP and MySQL you can still use another web host.

55%
Wordpress - 4 years experience
5%
MySQL - 5 years experience
48%
PHP - 5 years experience
3%
HTML - 7 years experience
10%
CSS - 6 years experience

In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the web) are typically connected by phone lines, digital satellite signals, cables, and other types of data-transfer mechanisms. A ‘data-transfer mechanism’ is a nerd’s way of saying: a way to move information from point A to point B to point C and so on.

The computers that make up the web can be connected all the time (24/7), or they can be connected only periodically. The computers that are connected all the time are typically called a ‘server’. Servers are computers just like the one you’re using now to read this article, with one major difference, they have a special software installed called ‘server’ software.

Server software is created to ‘serve’ web pages and web sites. Basically, the server computer has a bunch of web sites loaded on it and it just waits for people (via web browsers) to request or ask for a particular page. When the browser requests a page the server sends it out.

The short answer is: by typing in the URL, or in other words, the web site address. So for example, if you wanted to find the web site www.steven-media.ro, you would type in the address into your web browser’s address bar or maybe use your ‘favorites’ or ‘bookmarks’ link to StevenMedia.

There are other ways to find web sites (like search engines,) but behind the scenes web sites are all being found by going to the web site’s official address. That brings us our last nerd detail: how does a website get an official address so that the rest of the web can find it?