根据我之前解决的问题:Re-arrange mysql result in an expected format for hansontable。我要重新格式化mysql结果
[“高级”],[“豪华 - 城市景观”],[“豪华 - 阳台”],[“小型套房”],[“安达曼一室公寓”]
进入
["Superior","Deluxe - City View","Deluxe - Balcony","Junior Suite","Andaman Studio"]
从这些代码:
$sql_rName="select title from room_db where hotel='1' order by id asc";
$result_rName=mysql_db_query($dbname,$sql_rName);
while($rec_rName=mysql_fetch_array($result_rName)){
$_rName=$rec_rName['title'];
$_array[]=$_rName;
}
echo "{\"data\": ".json_encode($_array)."}";
mysql表:room_db
请建议。
附言。感谢 Olaf Dietsche 提供的所有这些帮助。