728x90

<?php
header("Content-Type: text/html; charset=utf-8");
header("Cache-Control:no-cache");
header("Pragma:no-cache");
echo "1234";
$query = "select * from user";
$result=db_connection($query);
 
$info=array();

while($row=mysql_fetch_array($result, MYSQL_ASSOC)) {
    array_push($info, array('name'=>urlencode($row['name']), 'email'=>$row['email'], 'password'=>$row['password']));  
}

$json_data = json_encode(array("info"=>$info));

echo urldecode($json_data);

echo "<br />";
echo "<br />";

var_dump(json_decode(urldecode($json_data)));
var_dump(json_decode(urldecode($json_data), true));

exit;
 
function db_connection($query)
{
 echo "1";
 $connect=mysql_connect("27.115.147.129", "root", "비번알지?");

 mysql_select_db("pling", $connect);
 
 mysql_query('SET CHARACTER SET utf8');
   
    return mysql_query($query);
   
    function fail($message)
    {
        die(json_encode(array('status'=>'fail','message'=>$message)));
    }
    function success($message)
    {
        die(json_encode(array('status'=>'success','message'=>$message)));
    }
}

?>



728x90

'Ndlessrain' 카테고리의 다른 글

슈퍼내츄럴  (0) 2014.05.17
pling project  (0) 2014.05.15
G500-59371804  (0) 2014.05.11
EV8200 [이본코리아] 보조배터리 8200mah  (0) 2014.05.08
Smart 슬림 UD1 USB3.0 [LG]  (0) 2014.05.08

+ Recent posts