Chapter 1. Introduction to MySQL and Perl

only for RuBoard - do not distribute or recompile

Chapter 1. Introduction to MySQL and Perl

graphics/chic01.gif

This book shows how to combine the power of relational database technology with the Web to provide information services that neither can deliver alone. A database engine and its support tools provide a variety of ways to extract, analyze, and present information that is important to you. This in itself is a useful asset; but when you connect your database to the Web, you gain several important capabilities and can accomplish even more:

  • You can provide database content as Web content to extend the reach of your information. This happens because your Web server acts as an information delivery system that works over the Internet in a relatively platform-neutral fashion. Businesses, for example, can make marketing information available on a global scale to sales personnel who carry with them nothing more than a Web browser. The Web has been available on desktop and laptop computers for several years, and now its use is beginning to spread to handheld devices such as PDAs and cell phones. This means your Web server has the potential to provide the information in your database even to these devices.

  • The content you provide through your Web server becomes dynamic because you can draw it from the information residing in your database and tailor it to the interests of individual site visitors. Static pages are fine for unvarying information, such as a list of definitions or a set of instructions. They are unworkable for information that changes frequently, or for situations where visitors need to interact with a Web site to find the information in which they are interested.

  • Your Web content is always as current as the information in your database because you re generating your pages directly from that database, not serving up static pages that went stale long ago.

  • You can gather information over the Web from clients and store it in a database. In effect, you can make your site act as an interactive data-collection engine.

Some types of dynamic content that use a database are very simple, such as displaying a hit counter in a Web page. Others are more complex, such as presenting a list of today s on-sale specials for a business, conducting an online poll and showing the current results, displaying stock prices, and performing inventory searches or order tracking.

Dynamic content is useful when you cannot anticipate a user s requirements, such as when you want to provide individualized customer support. You can use information in a database to drive and customize that interaction. Consider what happens when you call a help desk for assistance with a product, and you describe the problem you are having to the person on the other end of the phone. How does this person help you? In some cases, by typing in keywords based on your description to perform a search on a help-document database. Some companies have taken this to its logical conclusion and made the database available directly to customers on the corporate Web site. This enables customers to help themselves 24 hours a day without going through phone menus, answering machines, or being put on hold. It also might allow the company to lower support costs.

Another benefit of connecting your database to the Web is a potential reduction in workload. At first you might think that adding dynamic content to your site could only increase work because of the additional programming requirements. It s true that you don t add this capability without effort, but that effort often can save you work in the long run. Consider a scenario where you maintain a Web site in tandem with a database that consists of sports information such as team schedules, game results, league standings, and player statistics. Some of this information is static (the schedules), but the rest changes throughout the season and requires continual updates to your site. One way to accomplish this is by updating your Web pages manually as new information comes in. You can reduce your workload, however, if you go about it properly. Transform the job of updating the site from one of repeatedly modifying a set of static pages to one of writing a few programs that know how to extract the appropriate information from your database and display it to site visitors. The information has to go into the database anyway, so would you rather update the Web pages with the same information manually (in effect entering it twice), or write the programs? In my mind, there s no question: It is always more interesting to write programs than to perform a lot of mindless editing. And you only have to write each program once. Result: less work overall, even when you factor in occasional maintenance modifications to the programs.

Dynamic content doesn t necessarily involve a database. You don t need one to display the current date in a Web page, for example. But databases have so many applications on the Web that you are limited essentially only by your imagination and your technical expertise. If you ll bring the imagination, this book will help you with the technical end by taking you through the process of building useful, highly interactive, and dynamic Web sites from the ground up. As a bonus, this can be done using software that is freely available, so the methods shown in this book can be used by nearly anyone.

only for RuBoard - do not distribute or recompile


MySQL and Perl for the Web
MySQL and Perl for the Web
ISBN: 0735710546
EAN: 2147483647
Year: 2005
Pages: 77
Authors: Paul DuBois

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net