Three-level linkage of provinces, cities and counties with mysql+ajax
WBOY
Release: 2016-07-25 09:01:19
Original
978 people have browsed it
In PHP development, I want to write a mysql+ajax three-level linkage between provinces, cities and counties. Everything has been written, and I am just waiting to return data in xml or json format.
The query is: $sql="select * from cities where sid=1";//1 is the ID of Jiangsu Province. Needless to say this
$res=mysql_query($sql);
How to deal with the following, use a while loop or how to do it? The xml format I want is similar to
NanjingSuzhou
Reprinted from other people’s questions and answers. . .
I will send you the code including the database once to express my gratitude! ! !
php page:
//The two sentences here are very important. The first sentence tells the browser that the data returned is in xml format
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