Colleagues.
I am creating a registry where a request number is generated for the user. The structure is as follows:
$prefixo = "CAD";
$idCadastro = mysqli_insert_id($this->conexao);
$rand = rand(100,999);
$ano = date("y");
$CAD = $prefixo."-".$idCadastro.$rand."/".$ano;
It returns this way:
CAD-11231/17
In Mysql I am using the Varchar data type (255), however I am in doubt whether I should use this data type. The IdCadastro field is self-incrementing, so you do not run the risk of duplicating. Is there any other more specific data type for this or is Varchar (255) fine?