I have a question about the AUTOINCREMENT values in MySQL
In a system that I am developing allows you to save projects and the corresponding paperwork that must be kept (records, letters, forms), in the registration window it asks you to enter a code, which will be the ID, me in my project table I have the autoincremental value.
But what happens, the code I have to save the project reads the value that is in the proy_id text box, and then does the saving, if I left that empty box in the database if I kept the record as id: 1, id: 2, id: 3, but I did not save the paperwork because I could not find the project ID to save.
My question is how can I do so that an automatic value appears in the code, if possible the one that will be saved in the database, that comes out 1, 2, 3, 4, 5
<input type="text" maxlength="5" class="form-control" name="proy_id" id="proy_id" value="" placeholder="Código del Proyecto" >
</div>
</div>
They told me to put a "value", but I do not know how to call that from the database or how to generate it
this code saves the project and its requirements
<?php
include 'conexion.php';
bd_proyecto_agregar($_REQUEST);
foreach ($_REQUEST['requ'] as $requisito_id){
$requisito = array('proy_requ_id' => NULL, 'proy_id' => $_REQUEST['proy_id'], 'requ_id' => $requisito_id);
bd_proyecto_requisito_agregar($requisito);
}
header("Location: listado2.php");
exit;
?>