Home arrow JavaScript arrow Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX

Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX

If you're a web developer searching for a guide on how to build a dynamic banner application with AJAX, look no further. This series of articles might be what you need. Welcome to the final tutorial of the series that began with "Creating a Dynamic Banner System with AJAX." Made up of three articles, this series develops a basic web application that uses AJAX-based HTTP requests to display a group of dynamic banners based on a predefined time sequence.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 10
August 01, 2007
  1. · Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX
  2. · Listing the entire source files of the previous banner application
  3. · Fetching banner data from MySQL
  4. · Completing the banner application

print this article

Storing Banner Data in MySQL Tables for a Dynamic Banner System with AJAX
(Page 1 of 4 )


Now that you hopefully have a clear idea of the topics covered by this series, let me reintroduce some important concepts surrounding the implementation of this AJAX-driven banner mechanism, which were deployed in the previous article. As you'll possibly recall, over the course of that tutorial I introduced some changes to the original structure of the original banner system, specifically modifying the definition of one of its primary JavaScript functions, called "displayBanner()."

The most evident consequence in doing this modification was providing the application with the capacity to fetch the set of predefined banners directly from a simple XML file. This change enabled us to avoid needing the code and additional PHP file that initially retrieved all of the banner data from a plain text file. Additionally, since the aforementioned JavaScript function used the XML part of AJAX to display the different banners periodically on the browser, its overall structure became slightly more compact and maintainable.

All right, at this point I already mentioned all the pros of this AJAX-driven application, but I purposely didn't stress its main weakness, so I believe now is a good time to do it, right? As you'll probably remember, the sequence in which the different banners were shown was originally controlled by a unique, global JavaScript variable. This approach can not be recommended in terms of good programming habits.

Thus, considering that this issue should be fixed quickly, in this last installment of the series I'm going to adapt the original structure of the banner system to give it the ability to read all the banner-related data from a simple MySQL database table. In this way we will naturally avoid relying on a rather undesirable global JavaScript variable.

Now, let's get rid of the preliminaries and learn together how to modify the original AJAX application to work with a basic MySQL database table. Hopefully, it's going to be an instructive experience!

blog comments powered by Disqus

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials