-
Notifications
You must be signed in to change notification settings - Fork 0
코디셋.php
woosoo2 edited this page Mar 7, 2014
·
5 revisions
<?php
//print $_GET["tId"];
$con=mysql_connect("localhost","tv11","imtv11");
$sql = "select c.*,s.csname from ccgrp c join codyset s on c.csid=s.csid where cid=".$_GET["cId"]."";
// Check connection
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("tv11", $con);
$result = mysql_query($sql);
$resultArray = array();
$i=0;
while($row = mysql_fetch_array($result)){
$resultArray["codyset"][$i]=array();
$resultArray["codyset"][$i]["cid"]=$row["cid"];
$resultArray["codyset"][$i]["csid"]=$row["csid"];
$resultArray["codyset"][$i]["csname"]=$row["csname"];
$resultArray["codyset"][$i]["tid"]=$row["tid"];
$resultArray["codyset"][$i]["bid"]=$row["bid"];
$i++;
}
echo "". json_encode($resultArray,JSON_UNESCAPED_UNICODE) . "";
mysql_close($con);
?>{
"codyset": [
{
"cid": "",
"csid": "",
"csname": "",
"tid": "",
"bid": ""
},
.
.
.
]
}