• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Using SQL

Chapter 4. Using SQL

Structured Query Language, or SQL (usually pronounced “sequel”), is a very common language used in many database applications that provides a relatively simple, yet powerful, way to access a database. Because it’s an open standard, it’s used in a variety of database products, from freeware to those costing tens of thousands of dollars. Because SQL is so common and there’s a likelihood you’ll use it at some point, we’ll spend this chapter delving into the details of this language.

Using SQL, HTML, and a scripting language (such as PHP), you can create dynamic Web sites that integrate up-to-the-minute information with optimized design and content. Some of the most common ways to use SQL are tracking visitors to a Web site, providing an interface to a larger pool of information, or allowing site visitors to enter changes directly in a database. Tracking visitors can be as simple as remembering user names and passwords, or as comprehensive as remembering which menus the visitor wants to see when they return. Creating an interface to a larger pool of information can also be a relatively compact task, like looking up a co-worker’s phone number, or it can be significantly more involved, like requesting a reverse-threaded screw that’s one inch long with a rounded head. And letting visitors make changes directly to a database makes it easier to house up-to-date information, such as new mailing addresses or credit card numbers.

Although there are other database languages you can use with HTML and a scripting language to accomplish the same things, in this chapter we’ll focus on SQL for several reasons. For one, SQL is practically ubiquitous, and MySQL, one of the more popular SQL databases, is available without charge on a number of platforms, including Windows. Second, the combination of MySQL and PHP is one of the default configurations included in Dreamweaver MX. Because both components are available free of charge, you get maximum bang for your database/scripting buck when you use SQL. And finally, using PHP and SQL with Dreamweaver MX can be a great way to provide dynamic content on your Web site without mucking about with a large amount of scripting.

Even if Dreamweaver lets you off easy when it comes to scripting, it still makes sense to have at least a rudimentary knowledge of what’s going on behind the scenes when you’re working with something as complicated as a SQL database. You may not know all the details, but understanding what happens when the user clicks on the Submit button, for example, can help you design your applications most efficiently. If you don’t know what’s possible with SQL, you’ll miss an opportunity to add sophisticated features that could make the difference between someone returning to your site or visiting your competitors’.

This chapter provides an overview of SQL, shows you how to connect to a SQL server, and explains how to use it to embed dynamic content in your Web site.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint