<?php
//include_once("./include/config.php");
include_once("../common.php"); 

$bo_table=$_GET["bo_table"];
$q = " select * from g5_write_$bo_table ";

$rslt = sql_query($q);
$result = array(); 

// Äõ¸®¹®ÀÇ °á°ú(res)¸¦ ¹è¿­Çü½ÄÀ¸·Î º¯È¯(result) 
for ($i=0; $row=sql_fetch_array($rslt); $i++)
{
	//file list 
	$q1 = " select * from g5_board_file where bo_table='{$bo_table}' and wr_id='".$row['wr_id']."'";
	$rowA = sql_fetch($q1);

	array_push($result, array('title'=>$row['wr_subject'],'name'=>$row['mb_id'],'url'=> 'https://music1020.iwinv.net/data/file/{$bo_table}/'.$rowA['bf_file']));  
} 
	echo json_encode(array("result"=>$result),JSON_UNESCAPED_UNICODE); 
	
?>
