Chapter 15 . Perl Development 423 Figure 15-38: (Top web site)

Chapter 15 . Perl Development 423 Figure 15-38: Using a file handle to dump the results to a file instead of to STDOUT Though not technically necessary for the MySQL DBD, the finish()method can be used to recycle statement handles and improve the readability of your code. The finish() method releases the remaining results from a statement handle and frees it for another use. The MySQL DBD does not require you to finish before issuing another prepare statement, but doing so can greatly assist in tracing code if you need to go back and examine the code at a later date. Finally, if you have to clean up input received from a user or through a Web form, you should know about the quote()method that makes strings safe for use inside an SQL statement. It takes a sole argument the string to work with and results in an SQL-safe string. Figure 15-39 shows an example of the quote() method. Note When using the quote() method, you do not need to include quotes around the strings inside queries. Notice, for example, the change in the way the variable $safeuser is called in Figure 15-39.
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply