时间:2021-07-01 10:21:17 帮助过:20人阅读
include_once "config.php";
header("Content-type: text/html; charset=utf8");
$mysql=mysqli_connect($db_host,$db_user,$db_password,$db_name);
mysql_select_db($db_name,$mysql);
mysql_query("SET NAMES 'utf8'");
mysql_query("set character_set_client='utf8'");
mysql_query("set character_results='utf8'");
mysql_query("set collation_connection='utf8'");
$user=$_GET['user'];
$lat=$_GET['lat'];
$lng=$_GET['lng'];
//获取地理地址
date_default_timezone_set('PRC');
$into_time=Date("Y-m-d H:i:s");
$url="http://api.map.baidu.com/geocoder/v2/?ak=E6f2d2e9e662917d0e6eee74ced3db24&callback=renderReverse&location=".$lat.",".$lng."&output=json&pois=1";
$json=file_get_contents($url);
$xjson = substr($json,29,-1);
$point = $lat.'_'.$lng;
$data=json_decode($xjson,true);
$dress = $data['result']['formatted_address'];
file_put_contents("localjson.txt",$data.'--dress--'.$dress);
// $g="select akw_user.mobile from akw_user where akw_user.id in (select user_group.userid from user_group where user_group.sqlid='".$user."')";
//多表查询
$g="select akw_user.mobile from akw_user where akw_user.id in (select user_group.userid from user_group where user_group.sqlid = '".$user."')";
$ids= mysql_query($g);
[email protected]_fetch_assoc($ids);
$f=$n['id'];
echo '--f--'.$f.'--g--'.$g;
?>
新增后提示出错:select akw_user.mobile from akw_user where akw_user.id in (select user_group.userid from user_group where user_group.sqlid = '1409203388')
Access denied for user 'root'@'localhost' (using password: NO)
$g="select akw_user.mobile,akw_user.id from akw_user where akw_user.id in (select user_group.userid from user_group where user_group.sqlid = '".$user."')";
$ids= mysql_query($g);
[email protected]_fetch_assoc($ids);
$f=$n['id'];