次の PHP は無効な json を返します。
$sql = 'select * from website where websiteID = "'. $websiteID .'"';
$q = mysql_query( $sql ) or die(mysql_error());
$res = json_encode( mysql_fetch_assoc($q) );
echo $res;
ブラウザからコピーされたjsonは次のとおりです。
{"websiteID":"162","userID":"235","URL":"coucou","themeID":"1","telephone":"","websiteTitle":"","description" :"","キーワード":"","nomEntreprise":"","住所":"","email":"","Page1Title1":"parameter1","Page1Title2":"parameter2","Page1Title3 ":"parameter3","Page1Title4":"parameter4","Page1Title5":"parameter5","page1Title6":"parameter6","page1Title7":"parameter7","page1Title8":"parameter8","page1Title9": "parameter9","page1Title10":"parameter10","Page1Text1":"parameter11","Page1Text2":"parameter12","Page1Text3":"parameter13","Page1Text4":"parameter14","Page1Text5":"parameter15","Page1Text6":"parameter16" ,"Page1Text7":"parameter17","Page1Text8":"parameter18","Page1Text9":"parameter19","Page1Text10":"parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 parameter20 ","Page1Text11":"parameter21","Page1Text12":"parameter22","Page1Text13":"parameter23","Page1Text14":"parameter24","Page1Text15":"parameter25","Page1Text16":"parameter26","Page1Text17":"", "Page1Text18":"","Page1Text19":"","Page2Title1":""}
これを修正して有効なjson出力を渡すにはどうすればよいですか?
どうやらjsonは有効です。ブラウザからhttp://jsonlint.com/にコピーすると、何らかの理由でエラーが発生しました。