|
What is a Web Database?
A web database is a database for the internet. You can get access to your data via the internet from anywhere in the world or you can create a database driven website by using such databases. A web database stores large amount of information in an organized format that is easily accessible from scripting languages (like PHP). In web databases, modifications can be performed without any hassles.That makes the dense editing of the html code obsolete. Repeated types of data, such as contact information, can be generated automatically in your website through a web database. Daffodil DB: A web database Daffodil DB is a SQL-99 and JDBC standards compliant Java RDBMS. It is the first java database that is compatible with PHP. With the release of PHP extension module, Daffodil DB has joined the select list of Java enabled web databases. Daffodil DB is an ideal for anyone who is looking for a web database. It can be embedded within any application and delivers high performance with minimum system resource usage - thereby striking the right balance between size, features, and performance. At less than 3 MB, Daffodil DB is a small/compact database. Daffodil DB can run virtually on any platform as it supports all platforms for which a Java Virtual Machine (JVM) is available. These include Windows, Linux, Solaris, and UNIX. With the help of Daffodil DB, developers can build applications for any platform and these can be compiled and delivered on all other major platforms. PHP PHP ( Hypertext Preprocessor) is an open source server-side scripting language that is particularly suited for web development and can be used to generate dynamic web content. PHP scripts are embedded within web pages along with HTML, similar to other web scripting languages, such as Microsoft's ASP or Sun Microsystems's JSP. Like ASP and JSP, PHP runs on a web server (rather than on the Web browser or other client) when a page is requested via HTTP. PHP enables you to insert instructions into your Web pages, which your Web server software (be it Apache, Personal Web Server, or whatever) executes before sending it to a browser that requests them. PHP is easy to use for web development because it has been designed from the onset for the web environment. PHP has many built-in functions that make web programming simpler, so that programmers can focus on the logic of programming without wasting precious development time. PHP as a language has its own way of doing things, and it has borrowed features from other languages. But for many people, the main reason for learning a scripting language like PHP is because of the interaction with databases it can offer. Moreover, PHP is cross platform means it allows you to develop/use your solution on multiple OSs. PHP is one of the fastest growing server side scripting languages and you need to add it to your current arsenal of Perl, ASP, JSP, JavaScript, VBScript, and Java. PHP and Daffodil DB: Together ? Daffodil has come up with a PHP extension module that makes Daffodil DB/One$DB compatible with PHP. It is a database extension module driver that is required to work with Daffodil DB in PHP. This extension module uses the capabilities of a Java database and extends it to your web infrastructure. By using this extensive module, PHP developers can create sophisticated data-driven web applications having Daffodil DB as a web database in a fraction of the time and with reduced cost. PHP extension for Daffodil DB provides a simple, yet effective means for connecting to Daffodil DB within PHP. JVM is created using JNI invocation interface and everything runs in-process. This PHP Extension module boosts open source activities around Daffodil DB. Moreover, open Source stack -Linux, Apache, One$DB, and PHP; all being open source products give an ultimate combination to web development community. PHP is platform independent and Daffodil DB is also platform independent. PHP is free and Daffodil DB is also free (having open source version). So What about using the powers of two most promising technologies, PHP and Daffodil DB together�? The capabilities of Daffodil DB and PHP can make up what must be the best blend for data-driven Web sites on the globe. Users can use PHP and the Daffodil DB database to access/store information on the web and include it into their website. By using PHP as a front-end and Daffodil DB as a back-end web database, users can benefit from huge savings on the licensing costs of commercial alternatives. Here are some practical examples where PHP and Daffodil DB used together can do wonders Designing a database driven website Any site that successfully attracts repeat visitors for fresh and constantly updated content. But it can be very tedious if your have a HTML based website. Moreover, the maintenance of a content-driven site can be a herculean task too. Many sites feel locked into a dry because rewriting those hundreds of HTML files to reflect a new look would take a long time. The solution of this problem is a database driven site. In a database driven website, you have a web page that grabs information from a database (the web page is connected to the database by programming.) and inserts that information into the web page each time it is loaded. If the information stored in the database changes, the web page connected to the database will also change accordingly and automatically without human intervention. This is commonly seen on online banking sites where you can log in (by entering your user name and password) and check out your bank account balance. Your bank account information is stored in a database and has been connected to the web page with programming thus enabling you to see your most updated banking information every time u access the site. Add, edit & delete Web site content without using HTML One great thing about a database-driven site is that it keeps your site design and content separate with each other. By achieving complete separation between your site's design and the content you want to present, you can work with each without disturbing the other. Instead of writing an HTML file for every page of your site, you only need to write a page for each kind of information you want to be able to present. Rather then endlessly pasting new content into your tired page layouts, create a simple content management system that allows the writers to post new content themselves without a lick of HTML! If you have a large website and you want to change the design, it can take a very long time to update and upload all the pages. With PHP and Daffodil DB your whole website can be managed in just one or two PHP scripts. To update the website's design you just need to change one page. Banner Rotation Banners can be found on any dynamic website, as moving text attracts the visitor of a site more than a static text. But a million dollar question is how these banners work. Actually, on a site where there is a banner running, a PHP script is called. This script opens a database and picks a random banner from it to show the visitor. It also counts the number of times the banner has been viewed; and with a few changes, counts the track clicks too. To add, change, or edit the banners, one need to do is - just change the database and the script will pick the correct banners for all the pages on the site. Forums Forums/ message boards are among the most widely used applications of the internet. Now how do they work? Well, PHP magic again..!!! , and not to forget a web database is also needed to create such magic. These forums can be created using PHP and Daffodil DB. All the pages in the forum can be updated, whenever needed, by changing just one PHP script. Apart from all above mentioned applications, there are some more areas where users can use Daffodil DB-PHP 'dynamic-duo'.
Go Ahead: Give it a try So, now you are aware of both Daffodil DB and PHP, and what they can do if used together. It's the time to try your hand on some simple PHP scripts. Writing your first PHP Script Writing your first PHP script may seem a little scary at first, but relax. It's really easy. Here is the code for your first simple PHP script.
Make a Connection to a Daffodil DB database from PHP: The following sample code makes a connection to a Daffodil DB database from PHP and executes a simple query that fetches the data from the database and displays it. The example assumes you have a Daffodil DB user called "DAFFODIL" who can connect with a password "daffodil" from the server "127.0.0.1" on the port no 3456.
Congratulations! You just wrote your first PHP script. These were the two basic scripts for giving you the basic idea of how to go about using PHP and Daffodil DB together. Now, you can look forword to use both these technologies in developing your web applications. To know more about PHP visit http://www.php.net Please log on to http://cvs.php.net/co.php/pecl/daffodildb for more information on PHP and Daffodil DB. |
