633Chapter 34PostgreSQLinto an array. Next we call trim()to (Graphic web design)

633Chapter 34PostgreSQLinto an array. Next we call trim()to get rid of the superfluous space character left behind byexplode(). This is done because Windows systems submit an additional rwherever a linebreak occurs. If we explode on this as a separator, explodewill fail when the form is submit- ted from Linux, for example, because the character is not there. Finally, we iterate through the resulting array, putting each character into the characterstable with its own insert query, and we return a message of success or failure. When we went back to test our results, we found a few problems with index.phpand so wepresent a revised version in Listing 34-3. We could have just changed the original listing, butthis so nicely illustrates the debugging process that we ve included it this way to point outthe improvements. Listing 34-3:index.php (improved)

Cartoons and Characters Database

Your submission was successfully inserted. You can submit another, if you wish

); } else { print(

We were unable to insert the records as submitted. You can try again, if you wish

); } } else { print(

Welcome to the cartoons and characters database. Enter the ); print( name of your favorite cartoon below, and chooseContinued39
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Leave a Reply