Php 使用未定义的常量icontext-假定';icontext';
我得到这个错误,我能做什么 :41.343721 2017][:error][pid 1850][client 192.168.137.1:50094]PHP 注意:在中使用antic icontext-假定为'icontext' /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考:观看1本地列表 :41.343738 2017][:error][pid 1850][client 192.168.137.1:500941 PHP 注意:Unde rext在 /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考:观看1本地列表 :41.343746 20171[:error![pid 1850][client 192.168.137.1:500941 PHP 注意:在中使用tant hinttext-假定为'hinttext' /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考:观看1本地列表 :41.343753 20171[:error![pid 1850][client 192.168.137.1:500941 PHP 注意:在中使用BallootText-假定为“BallootText” /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考:观看1本地列表 :41.343760 20171[:error![pid 1850][client 192.168.137.1:500941 PHP 注意:在中使用styleplacemark-假定为'styleplacemark' /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考:观看1本地列表 :41.343767 20171[:error![pid 1850][client 192.168.137.1:500941 PHP 注意:Unde;中的Placemark /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考者:watch1list.local :41.343775 20171[:error![pid 1850][client 192.168.137.1:500941 PHP 注意:在中使用tant lat-假定为“lat” /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考者:watch1list.local :41.343783 20171[:error![pid 1850][client 192.168.137.1:500941 PHP 注意:在中使用tant Ion-假定为“Ion” /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考者:watch1list.local :41.343794 20171[:error![pid 18501[客户端192.168.137.1:50094!PHP 注意:使用标记-在中假定为“标记” /home/coder/samba/public_htm1/watch1ist.loca1/vivodpointsmap-cat.php 第19行,参考人:Watch1List.localPhp 使用未定义的常量icontext-假定';icontext';,php,mysqli,Php,Mysqli,我得到这个错误,我能做什么 :41.343721 2017][:error][pid 1850][client 192.168.137.1:50094]PHP 注意:在中使用antic icontext-假定为'icontext' /home/coder/samba/public_htm1/watch1ist.loca1/php/vivodpointsmap-cat.php 在第13行,参考:观看1本地列表 :41.343738 2017][:error][pid 1850][client 19
您没有在
“
引号中包含$json
的键。它应该是这样的:
header('Content-Type: text/html; charset=utf-8');
require ("bd.php");
if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
$result = mysqli_query($link, "SELECT * FROM ymapapiv2_markers_cat");
if(mysqli_num_rows($result)>0)
{
while ($mar = mysqli_fetch_array($result))
{
$json = array(icontext=>$mar['iconText'], hinttext=>$mar['hintText'], balloontext=>$mar['balloonText'], styleplacemark=>$mar['stylePlacemark'], lat=>$mar['lat'], lon=>$mar['lon']);
markers[] = $json;
}
}
$points = array(markers=>$markers);
echo json_encode($points);
}
[Thu Nou 23 04:28:15.343836 2017][:error][pid 1851][client 192.168.137.1:50177]PHP注意:未定义索引:stylePlacemark in/home/coder/samba/public_html/watchlist.local/PHP/uiuodpointsmap-cat.PHP第13行,referer:watchlist.local
@originalbater这只意味着$mar
数组没有stylePlacemark
的值。需要注释来掌握上下文。请更新。发生了哪些更改您试图对代码进行修改?这有什么不同吗?是否可以显示相同的内容来删除显示为错误的项目?然后一次添加一个项目以查看问题的真正所在?代码中的icontext
是什么?我看不到它的定义。
$json = array('icontext'=>$mar['iconText'], 'hinttext'=>$mar['hintText'], 'balloontext'=>$mar['balloonText'], 'styleplacemark'=>$mar['stylePlacemark'], 'lat'=>$mar['lat'], 'lon'=>$mar['lon']);