What is SQL?
You probably noticed that many of these products include the acronym SQL (often pronounced “sequel”). This is a term which arises very often when discussing databases. It stands for Structured Query Language and is a language that all relational databases understand. A “database query” is something that a user asks the database, and SQL is the language that query is written in.You don’t actually need to know much about SQL to operate a database (especially when using something like Microsoft Access) because it hides the SQL behind menus and toolbars and nice little pop-ups. However, SQL is a fairly simple language, so this section provides a brief introduction.
What is a database-driven Web site?
Now that you know the database basics (what they are, how to use them, who makes them and how to query them) it’s time to return to the initial problem—how to keep up with your competitors and their fancy new Web sites.Individual Web pages on any Web site are either static or dynamic. A static Web page is one that can only be changed by logging into the server and replacing the Web page with a new version. A dynamic Web page is one that knows how to read its information from a database. For example, your Web site might display a list of all your the clients from your clients table. When you change the data in your database to reflect that Smith Records has just moved to Manchester, this change is automatically reflected on your Web site. The page is no longer static because it dynamically displays the contents of your database.Since the data in your database drives the content on your Web pages, it is considered “database driven.”
How can my Web site read from my database?
This is the hard part. It is easy enough to have a Web site, and databases aren’t too difficult either, but how on earth do you get the former to talk to the latter? The answer is twofold.First, your Web site and your database will probably need to be situated on the same computer, or at least in the same local network. This may seem inconvenient because your Web site is probably on a computer in a big warehouse in a city hundreds of miles away.
However, your Web server may already have some database software installed (usually SQL Server on Windows servers and MySQL on Linux servers), or you can ask your host to install it for you. Once the software is up and running, there are plenty of tools to allow you to administer the database remotely. Second, you need some glue to connect your Web site to your database. For this you will need more software and probably a programmer.
Again, the software is probably already on your server. On a Windows server it is usually .NET, and PHP on a Linux server (there are alternatives, such as Java Beans, Java Struts and ColdFusion). These bits of software all know how to communicate with databases and turn the results into dynamic Web pages. Then you just need to call up your favorite IT guy and say “Make it work!” He’ll write various scripts which refer to the database and output HTML. Here is an example of such a script in PHP:
$connection = mysql_connect (“localhost:3066″, “paul”, “8asdfk3″);
$query = mysql_db_query (“test”, “SELECT * FROM clients”, $connection);
while ($row = mysql_fetch_array ($query)) {
print $row["name"] . ” is located in ” . $row["city"] . ”
“;
}
First, the script connects to a MySQL database (specifying the server location, port, user name and password). Then it runs a query using that connection (passing in the database, the query on the clients table, and the $connection variable). Then it loops through each of the results and prints out the clients’ names and cities.This is one of the most expensive parts of the process, but once it is working you will be able to make all changes on your Web site very quickly.
Conclusion Hopefully this article has served to demystify databases and how to start using them. Now know that a database is just a handy and structured place to put all your data. You know what database software is for, who makes it and why there can be such huge price differences.Your grasp of SQL is tenuous, but at least you know what it stands for.see more of integrated solutions
And finally, the phrase “database-driven Web site” no longer scares you, because it’s just about people putting stuff in a database and having it automatically appear on a Web site.And when you have commissioned and received your brand new, database-driven, fully dynamic Web site, you can feel very proud that you are keeping up with your competitors. You can also be happy that you’ll still have a reason to call your IT guy, who is working for you again from his cottage in Barbados.