Php, XML, XSLT, and Mysql

Source: Internet
Author: User

Users often see some posts about php (as the mainstream development language), xml (standardization is getting closer and closer), and the combination of databases, and some beginners.
The php (as the mainstream development language) code is mixed with HTML code, and the error cannot be found in the case of an error, so I am eager to turn it around.
Let's talk about how to use xml (standardization is getting closer and closer) technology to separate HTML code from php (as the mainstream development language) programs. Of course, there are many separation technologies, for example, in PEAR
IT template.
In general, I personally think that the use of xml (standardization is getting closer and closer) technology is the most convenient. If we don't talk much about it, let's get down to the truth,
Let's talk about the installation in win2000.

Using php (as the mainstream development language) xml (standardization is getting closer and closer) and xslt requires some dll libraries,
Extension = php (as the mainstream development language) _ domxml (standardization is getting closer and closer). dll // function library for operating xml (standardization is getting closer and closer)
Extension = php (as the current mainstream development language) _ iconv. dll // transcoding, such as converting GB2312 into a UTF-8
Extension = php (as the mainstream development language) _ xslt. dll // function library of XSLT

When using the above three libraries, you need to add the dlls directory under the php (as the current mainstream development language) installation directory to the path, otherwise it will not be found
The

In the following course, we will use the PEAR class library in php (as the current mainstream development language), mainly using the DB class library and Sql2xml (standardization is getting closer and closer) class library.
Pear. php (as the mainstream development language). net to download the latest version
After downloading the above two class libraries, you 'd better set them in php (as the mainstream development language). ini.
Include_path = ".; d: php (as the mainstream development language) pear"

D: php (as the mainstream development language) pear is the installation path of my pear

After setting, restart the machine. Otherwise, apache (the most popular WEB server platform on Unix) cannot be started properly because the path cannot be found.


So far, we have to use php (as the mainstream development language) xml (standardization is getting closer and closer) and XSLT settings. Is it easy :)
Linux users can
Http://www.gingerall.com/download the source code for release t.
Http://www.gnu.org/software/libiconv/download source code for iconv

The combination of php (as the mainstream development language) and xml (standardization is getting closer and closer), XSLT and MySQL (the best combination with PHP)
Next I will talk about a simple process of extracting data from the database, generating xml (standardization is getting closer and closer) documents, and converting to HTML using XSLT,
This process only describes the process of using this technology, and does not involve paging and other technologies.

In this example, I use the following database tables and data
Table Name: enterprise user information table, English name: yhxx
Table Structure:
#
# Data table structure 'hxx'
#

Create table yhxx (
Nsnm varchar (15) not null default,
Qymc varchar (200) not null default,
Qydh varchar (50) not null default,
Prima (the most comprehensive virtual host Management System) ry key (nsnm)
) TYPE = MyISAM COMMENT = user information table;

#
# Data table content 'hxx'
#

Insert into yhxx VALUES (310109040111985, Qiao Jia Food Development Co., Ltd., 8621-63346626 );
Insert into yhxx VALUES (310104040221736, Shanghai Jialing Trading Co., Ltd., 74292546 );
Insert into yhxx VALUES (310108040331576, emerald art company, 54861465 );


Next, I will write the data extraction program and the data display page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.