Job Recruitment Website - Job information - How to use php to output the provinces and corresponding cities across the country based on city codes

How to use php to output the provinces and corresponding cities across the country based on city codes

id fid name

The same idea as classification,

Add a fid to the city table to record the ID of the province to which it belongs

Provincial level Then fid is 0

With the province id, take out the corresponding city select * form city where fid = id;

According to the name of the province, first find out the id corresponding to the province, and then check the corresponding city