我有3个连续运行的查询,我想将Case_ID
存储到
$json_out = "[" . json_encode(array("result"=> )) . "]";
这样我就可以通过localstorage将它存储在HTML中。我如何实现这一目标?
PHP
$query = "insert into `Case`(`informant_userid`,`CaseName`,`CaseTime`) values ('" . $informant_userid . "','" . $CaseName . "',now());";
$query.= "insert into Picture (Case_Pic,Case_ID) values ('" .addslashes($imagefile). "', LAST_INSERT_ID());" ;
$query.= "SELECT `Case_ID` from `Case` ORDER BY `Case_ID` DESC LIMIT 1 ";
Echo($query);
$result = $conn->multi_query($query);
$count = $result->fetch_array(MYSQLI_NUM);
$json_out = "[" . json_encode(array("result"=>$count[0])) . "]";
if (!$result){
$json_out = "[" . json_encode(array("result"=>0)) . "]";
}
else {
$json_out = "[" . json_encode(array("result"=> )) . "]";
}
echo $json_out;