我有这个脚本..首先我运行查询1并存储到数组然后查询2,使用foreach,我将它们组合并创建一个url列表..但这需要时间..有没有办法我可以做到这一点mysql 通过组合表,他们甚至没有共同的列?
查询 1
SELECT
c.id,
c.city_name,
r.region_name,
cr.country_name
FROM city AS c, region AS r, country AS cr
WHERE r.id = c.id_region
AND cr.id = c.id_country
AND cr.id IN
(SELECT id FROM country WHERE used = 1)
查询 2
SELECT id, title FROM param WHERE active = 1
环形
foreach ($arrayCity as $city) {
foreach ($arrayParam as $param ) {
$paramTitle = str_replace(' ', '+', $param['title']);
$url = 'http://url/city/'. $city['id'] .'/paramId/'. $param['id'] .'/'.
$paramTitle .'/'. $city['region_name'] .'/'. $city['city_name'];
}
}