i am creating an app that upload files in the database. for example i upload 3 files at the same time and i want their IDs to be the same. then i will upload again another batch of files and their IDs should also be the same but the id is now incremented. \
I am using two IDs DM_ID and id. DM_ID is auto incremented while id is not. I want to get the last value of id. DM_ID and id is in one table.
i tried this code but it is not working
$result = mysqli_query($con,"SELECT id from __scannedfiles order by id desc limit 1 ") OR die(mysqli_error($con));
$row = mysqli_fetch_array($result);
$file_id = $row[0];
mysqli_query($con,"INSERT INTO __scannedfiles VALUES ('','$file_id'+1,'$file_title', '$file_name','$file_pic','$file_deptname','$file_doctype','$file_date','$file_desc')");