<?php
$link = mysqli_connect("localhost","root","","automated_ballot_voting") or die("died");
mysqli_select_db($link,"automated_ballot_voting") or die("diewd");
$sql="INSERT INTO automated_ballot_voting.voter VALUES ('$fname','$lname','$dateob','$sx','$ag','$stats','$prov','$citi','$cnc','')";
mysqli_query($link, $sql);
mysqli_multi_query($link,$sql);
$query= "select concat(sex,substr(cnic,1,3),Substr(firstname,1,3),length(city),length(province),Substr(city,1,2)) from voter where cnic='$cnc'";
mysqli_multi_query($link,$query);
$result = mysqli_use_result($link);
$row= mysqli_fetch_row($result);
$id=$row[0];
echo "This is your voting ID"."<br>" ;
echo "<h1>".$id."</h1>"."<br>";
echo "Save it for later use"."<br>";
echo "Thanks" ;
$que= "insert into voter (id) values ('$id')";
mysqli_multi_query($link, $que);
mysqli_free_result($result);
mysqli_close($link);
?>
我想使用第二个查询的结果,即第三个查询$ que中存储在$ id中的$ query,但第三个查询甚至不运行,有人可以帮忙吗?