-2
Next, I am working on a design of a system that has as one of the parameters "series".. I need from the "Save" button it takes the value of the series, save it in postgresql and show the next number on the screen..
Example: Series:'0002', click on the 'Save' button, add in the database, show on the screen the following number:'0003' so that a new registration can be made..
I know it’s simple, but I’ve never worked with php and am doing in the race rs
I appreciate the help!
part of the series:
<div class="col-sm-2">
<label for="exampleInputEmail1">Série</label>
<input name="serie" id="idserie" class="form-control" type="text"
value="00001" disabled>
</div>
part of saving:
</div>
<button id="btnslv" type="button" class="btn btn-success btn-block"
name="button">SALVAR</button>
</div>
php part:
<?php
//inicia uma conexão com o banco de dados orcamentos.
require "orcamento.php";
require "conexao.php";
if ($conn) {
function slvserie (){
$sre_id = $_GET['serie'];
$SQL = "INSERT INTO dds_cli(sre_id) VALUES ({$sre_id})";
pg_query($conn, $sql);
echo "++Registro inserido com sucesso!!";
pg_close($conn);
}
}
else
{
echo "++ Falha na conexão com o PostgreSQL!!";
}
?>
I’m not using any framework.
I recommend editing and putting the code you have in php and HTML (basically the form part), is using some framework ?
– Bulfaitelo