I'm increment an ID from my code. When I retrieve the maximum value from database it does't assign to the variable.
I test my query from database SQL then it shows the maximum value. but when I echo it doesn't show.
Here is my code,
<html>
<body>
<form enctype="multipart/form-data" method="post" action="test_issue.php">
<input name="submit" type="submit" id="submit" value="submit" />
</form>
</body>
</html>
<?php
include ("connection.php");
if(isset($_POST['submit']))
{
// $queryselect = "SELECT issued_id FROM pass WHERE pass_id=8";
$queryselect= "SELECT MAX(issued_id) FROM pass WHERE status='Issued'";
$last_sec_result = mysqli_query($connection,$queryselect );
if($last_sec_result!=0)
{
$last_sec_value = mysqli_fetch_array($last_sec_result);
$sec_id_no = $last_sec_value['issued_id'];
echo $sec_id_no;
}
else
{
echo $last_sec_result ;
echo "database query failed please check data you enter.";
}
// echo $sec_id_no;
}
?>
When I retrieve value with a simple select query (SELECT issued_id FROM pass WHERE pass_id=8) it shows the value. I'm stuck with this. Can anyone help me Please.
echo $sec_id_no;givevar_dump();?