获取json时出错:json / json.php [英] Error getting json:json/json.php
问题描述
我希望在iis manager 7中发布我的在线日历。在此之前我使用phpmyadmin和notepad ++创建..一切都很好..但现在我需要更改为oracle..i已经尝试谷歌并更改oracle连接..在那之后,我把我的文件放在iis..add mimetype,处理程序映射,但我得到了同样的错误,这是'错误得到json:json / json.php'..
有人能帮助我吗?因为我不熟悉json和oracle ..要么我的代码错了,要么我需要在我的电脑上另外设置..
非常感谢..
以下是我的json.php: -
标题( Access-Control-Allow-Origin:*);
header( Content-Type:application / json; charset = UTF-8) ;
$ DB = ' //10.14.61.62:1521/XE'跨度>;
$ DB_USER = ' USERNAME'跨度>;
$ DB_PASS = ' password'跨度>;
$ con = oci_connect($ DB,$ DB_USER,$ DB_PASS,)或die(oci_error());
oci_select_db( 10.14.61.62:1521/JURISDB,$ con);
$ query = 来自USERNAME的SELECT * .events;
$ result = oci_query($ query)或 die(oci_error());
$ arr = array();
while ($ row = oci_fetch_assoc($ result)){
$ arr [] = array(
date => $ row [ date],
title => $ row [ title],
description => $ row [ description],
url => ; ,
);
}
echo json_encode($ arr);
die();
?>
我尝试了什么:
i添加了mimetype,处理程序映射,在控制面板中设置..但仍然有一些错误..
DB = ' // 10.14.61.62: 1521 / XE'跨度>;
DB_USER = ' USERNAME'跨度>;
DB_PASS = ' 密码跨度>;
i want publish my online calendar in iis manager 7..before this i create using phpmyadmin and notepad++..everything is okay..but now i need to change to oracle..i had try google and change oracle connection..after that, i put my files in iis..add mimetype, handler mapping, but i got same error which is 'Error getting json:json/json.php'..
Can someone help me?because im not familiar with json and oracle.. either my code is wrong or i need to make another setting in my pc..
Many thanks..
below is my json.php:-
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
$DB = '//10.14.61.62:1521/XE';
$DB_USER = 'USERNAME';
$DB_PASS = 'password';
$con=oci_connect($DB, $DB_USER, $DB_PASS,)or die(oci_error());
oci_select_db("10.14.61.62:1521/JURISDB",$con);
$query = "SELECT * from USERNAME.events ";
$result = oci_query($query) or die(oci_error());
$arr =array();
while ($row = oci_fetch_assoc($result)) {
$arr[] = array(
"date" => $row["date"],
"title" => $row["title"],
"description" => $row["description"],
"url" => "",
);
}
echo json_encode($arr);
die();
?>
What I have tried:
i had add mimetype, handler mapping, setting in control panel..but still get some error..
DB = '//10.14.61.62:1521/XE';
DB_USER = 'USERNAME';
DB_PASS = 'password';
这篇关于获取json时出错:json / json.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!