0
選擇兩個領域我有mysql表:如何在一個申請
id | nameEng | NameRus
1 | Moscow | Москва
2 | London | Лондон
我要的是:
$result = array (
1 => array (id => 1, Name => "Москва"),
2 => array (id => 1, Name => "Moscow"),
3 => array (id => 2, Name => "London"),
4 => array (id => 2, Name => "Лондон")
)
這裏是我的查詢:
mysql_query("SELECT id, nameRus FROM citynames WHERE nameRus LIKE '%".$_GET['chars']."%'
UNION ALL
SELECT id, nameEng FROM citynames WHERE nameEng LIKE '%".$_GET['chars']."%' ORDER BY nameEng LIMIT 0, 10"
查詢工作但我想優化此查詢
'2 => array(id => 1,Name =>「Москва」)',以及'「...」中的所有字符串 – 2015-02-08 05:05:20
我想優化查詢@Ruben Kazumov – Newmaster 2015-02-08 05:14:14
我完全理解你的激情! – 2015-02-08 05:15:00