<?php
header("Content-Type: text/html;charset=utf-8");
$url = "localhost";
$user = "root";
$password = "";
$scenicArray = array();
$i = 0;
$con = mysql_connect($url,$user,$password);
if (!$con){
die('Could not connect: ' . mysql_error());
}
mysql_query("set names 'utf8'");
mysql_select_db("smart_tour");
$query = "select Scenic_Id,Scenic_Name,Scenic_city,Scenic_photo from `scenic`";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$scenicArray[$i]['Secenic_Id']=$row['Secenic_Id'];
$scenicArray[$i]['Scenic_Name'] = $row['Scenic_Name'];
$scenicArray[$i]['Scenic_city'] = $row['Scenic_city'];
$scenicArray[$i]['Scenic_photo'] = $row['Scenic_photo'];
$i++;
}
mysql_close($con);
$scenicJson= json_encode($scenicArray);
echo $scenicJson;
?>
Notice: Undefined index: Secenic_Id in D:\wamp\www\sceniclist.php on line 17
$scenicArray[$i]['Secenic_Id']=$row['Secenic_Id'];
Undefined indexé误çç¨åºéé¢çæ°ç»ä¸æ ä¸åå¨ï¼ä½ è¿é$row['Secenic_Id']éï¼æ²¡æä¸æ 'Secenic_Id'ï¼å ä¸ºä½ çæ¥è¯¢è¯å¥æ¯â$query = "select Scenic_Idâï¼æ¥è¯¢ç第ä¸ä¸ªå段æ¯Scï¼ä½ 使ç¨çæ¯Secï¼æåºå«ã追é®
åååï¼æç®ç´å¤ªä¸è®¤çäºï¼è°¢è°¢å¦ï¼
追çæ©ç¥éä½ è¿ä¹æ¸ éæé½ä¸åæé£ä¹å¤åäºã