A PHP: Hypertext Processor (PHP) script may be embedded in an HTML page; or run as a .php script in a web server such as Apache web server. PHP statements are included in <?php ?> tags. PHP 5.1.4 is the latest version of PHP and includes extensions for various databases; the PHP extension for DB2 UDB is available in the …
I do hope that the rest of the article is better researched than the "Why PHP?" section. In one paragraph you've made two contradictory statements, and only one of them can be correct.
Here are your contradictory statements:
1. PHP scripts may be included in HTML and don't need compilation and they run on most web browsers.
Obviously, only number 2 is correct. PHP is server side only, so PHP scripts don't "run on most web browsers" - they don't run on any web browser at all.
I'm not familiar with the ibm_db2 extension to PHP, so I can't really comment on the accuracy of the rest of the article. I will say that the text appears to be mostly a paraphrasing of the imb_db2 manual, with no additional information and some interesting things from the manual ignored. A link to a complete copy of the manual would be useful. The one given doesn't work properly. Many of hte pages don't have any content. This one is complete: http://www.php-editors.com/php_manual/ref.ibm-db2.html
A better introduction would have included a section on why to use DB2 as opposed to some other DB, and a general discussion of how to go about using the ibm_db2 extension.
A statement of the actual goal of the tutorial would be a good thing as well.
I do hope the following parts of this tutorial will be of higher quality.
Sorry, the manual reference is my fault - it looked OK on the night :( I've replaced it with what seems to be a better one.
PHP Script encoding on Web Browser.
The statement "PHP scripts may be included in HTML and don't need compilation and they run on most web browsers." implies that most web browsers encode data for PHP to decode on server side.
For example, consider a form element as shown in following code snippet; the web browser urlencodes $data to be sent to the server and on the server side the PHP script urldecodes the $data.
echo "<input type='hidden' value='" . htmlspecialchars($data) . "' />\n";
Thanks for the correct link to the PHP DB2 documentation.
The article explains some of the commonly used PHP DB2 functions. Alternatively, a developer would refer to the documentation for which functions to use.
As for "A better introduction would have included a section on why to use DB2 as opposed to some other DB."
PHP provides extensions for various databases such as Oracle, SQL Server, DB2, MySQL, PostgreSQL, Informix. The choice of DB2 is arbitary. Procedure for other databases is similar.
As for "and a general discussion of how to go about using the ibm_db2 extension."
The next of PHP DB2 article explains the procedure to use the IBM DB2 extension.
"A statement of the actual goal of the tutorial would be a good thing as well."
The goal of the tutorial is to introduce PHP in general and explain the procedure to use the PHP DB2 extension.
Why not PDO?
If your intention is to introduce PHP, why confuse the issue with the DB2 focus. Regardless of that, why not introduce PDO as a means of accessing databases given that it is (supposed) to give a database independence.
This is frankly uninspiring stuff. Even IBM suggest using PDO (and that in an article dated March 2005 - http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0505furlong/)
I suggest that you abandon this series of tutorials and start again with a better idea of what you are trying to achieve and how you are going to do it.
PHP Extension/PDO Advantages
PDO does provide a generic connectivity with any of the databases, but the PHP extension for the DB2 database, as the PHP extensions for other databases, provide additional functions to access a database.
PDO Extension Disadvantage
A disadvantage of using the PDO extension is that it does not support PHP versions earlier than PHP 5.
I apologize for some paraphrasing, which was meant to provide a summary reference to the PHP/DB2 extension functions. Some of the comments on the PHP/DB2 -I article are not correct. PHP requires some processing on the web browser and the PHP DB2 extension has some advantages over the PDO extension.
Thanks for the Feedback
Thanks for the feedback, I have included your suggestions in the Accessing DB2 UDB with PHP-II article.
- iPad? More like iFAD: We reveal why Apple ran off to IBM
- +Analysis Microsoft: We're making ONE TRUE WINDOWS to rule us all
- Climate: 'An excuse for tax hikes', scientists 'don't know what they're talking about'
- Analysis Nadella: Apps must run on ALL WINDOWS – PCs, slabs and mobes
- Apple: We'll unleash OS X Yosemite beta on the MASSES July 24