Considerations for selecting databases and related software in PHP development_PHP Tutorial

WBOY
Release: 2016-07-15 13:22:53
Original
803 people have browsed it

There are different PHP versions. The upgrade and development of 4.0 series 4.4.x has been stopped. However, some production environments are still running this version and the code needs to continue to be maintained. The PHP 5.0 series is the mainstream version currently developed and applied, including the 5.1.x and 5.2.x series. PHP 6.0 is still a trial version, and people who develop software products using PHP can now conduct compatibility testing in advance.

PHP supports many databases, including PHP’s own database driver components, such as mysql.dll, oci_oracle, etc. PHP is promoting its universal database driver component PDO from version 5.1 onwards. Through this highly abstract database access component, PHP can support most of the current database products, and the number is still increasing, with great scalability. Third-party manufacturers have been developing ADODB database access components for a long time and are still making progress.

Among the database components supported by PHP itself, the most popular one currently is the MySQL component. PHP 4.0 and 5.0 use different function groups to support Oracle. 5.0 is compatible with 4.0, but the function names have been changed. PHP4.0 uses functions such as OCILogon(), OCIParse(), OCIExecute(), and OCIFetchInto(). PHP5.0 uses functions such as oci_connect(), oci_parse, oci_bind_by_name(), oci_execute(), oci_fetch_all(), etc. It can be seen that it is closer to MySQL's function naming. These functions are developed using C language to extend PHP, and are theoretically the most efficient. However, perhaps due to lack of information and other reasons, not many people seem to use them. Its paging code for Oracle tables is also relatively complex.

The ADODB component is almost identical to the ADO component packaging used by ASP.NET under Windows. People who have done ASP/ASP.NET + ACCESS/MS-SQLServer development should be familiar with it and it is easy to get started. Therefore, if you use PHP for MS-SQLServer or Oracle development, ADODB should be considered. ADODB supports both PHP versions 4.0 and 5.0, while PDO only supports PHP versions 5.1 and above. This should also be considered. It is not a big problem when doing projects. For products, you must consider the applicability of the version and the deployment environment of the software. .

A code example of PHP using ADODB component to access Oracle9i database:

require_once("adodb/adodb.inc.php"); // Contains ADODB class library

$db = ADONewConnection("oci8"); //Specify Oracle8.0 or above database

$db->Connect("mydb9", "scott", " tiger"); //The three parameters are the database network service name, user (scheme) and password

$rs = $db->Execute("select * from emp"); //Execute SQL Statement

//Get the data in the record

while (!$rs->EOF)

{

echo $rs->fields [JOB] .'
';

$rs->MoveNext();

}

?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446947.htmlTechArticlePHP versions vary. The ones that have stopped upgrading and developing include 4.4.x of the 4.0 series, but some are still in production. The environment is running this version and needs to continue to maintain the code. PHP 5.0 series is now developed...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template