I want to put variable and string in mysql.
The json code was output by the API.
json view:
Array(
[body] => Array
(
[items] => Array
(
[0] => Array
(
[bizesId] => 333333
[lon] => 00.000000
[lat] => 00.000000
)
)
)
PHP code:
for ($i=0; $i<=1000; $i++) {
foreach($result_json['body']['items'] as $arr){
if(mysqli_query($con, "INSERT INTO TEST (`num`,'market',`lon`,`lat`) VALUES ('". $arr['bizesId'] ."','test','". $arr['lon'] ."','". $arr['lat'] ."')")){
}
}
}
Data can not be saved.