我有以下代碼:如何在一個數組中連接兩個字段?
$result = mysql_query("SELECT first_name, last_name, employeeID FROM ecc_employee WHERE first_name != '' ");
$resources = array();
while ($row=mysql_fetch_array($result)){
$name = ($row['first_name']);
$id = $row['employeeID'];
$resources[] = array(
'name' => "$name",
'id' => "$id"
);
我需要$名稱同時擁有姓氏和名字。我將如何做到這一點?
我將如何宣佈$名稱=
SELECT CONCAT(first_name的, 「」,姓氏)名稱,僱員FROM ecc_employee WHERE ... – 2013-04-08 14:41:44
$名稱[FIRST_NAME ] =姓氏; – 2013-04-08 14:43:38