db_connector.php 491 Bytes
<?php
	//쿼리
	$query = "select * from wello.policy";
\	mysql_select_db("admin", $conn);
	
	mysql_query("set 정책명 utf8"); //간단히 이거 한줄이면 되네

	$result = mysql_query($query, $conn);

	while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		$res['정책명'] = urlencode($row["정책명"]);
		$res['링크'] = urlencode($row["링크"]);
		$arr["result"][] = $res;
	}
	
	$json = json_encode ($arr);
	$json = urldecode ($json);
	print $json;
	mysql_close($conn);
?>