Skip to content
woosoo2 edited this page Mar 7, 2014 · 1 revision

###http://www.finfra.com/~tv11/clothes.php?csId=

<?php
//print $_GET["tId"];

$sql = "select c.csid,c.tid,t.tname,t.t_url_1,b.bid,b.bname,b.b_url_1 from codyset c join top t on t.tid=c.tid join bot b on b.bid=c.bid where c.csid=".$_GET["csId"]."";

$con=mysql_connect("localhost","tv11","imtv11");
// Check connection
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("tv11", $con);
$result = mysql_query($sql);
$resultArray = array();
if($row = mysql_fetch_array($result)){
	$resultArray["clothes"]=array();
	$resultArray["clothes"]["csid"]=$row["csid"];
	$resultArray["clothes"]["tid"]=$row["tid"];
	$resultArray["clothes"]["tname"]=$row["tname"];
	$resultArray["clothes"]["t_url_1"]=$row["t_url_1"];
	$resultArray["clothes"]["bid"]=$row["bid"];
	$resultArray["clothes"]["bname"]=$row["bname"];
	$resultArray["clothes"]["b_url_1"]=$row["b_url_1"];
}
echo "". json_encode($resultArray,JSON_UNESCAPED_UNICODE) . "";
mysql_close($con);

?>

{
    "clothes": {
        "csid": "",
        "tid": "",
        "tname": "",
        "t_url_1": "",
        "bid": "",
        "bname": "",
        "b_url_1": ""
    }
}

Clone this wiki locally