I have a primary key column, containing id so it must be unique
the content look like this
format of id is <index>/<division>/<month in roman>/<last 2 digit of year>
my question is what the best query to check if id already exist, and create id with
<index>+1/<division>/<month in roman>/<last 2 digit of year>
this is my function to generate id
public function gen_id($id_type = "HL.BY") {
$id_num = 123;
$month = $this->romanic_number(date("n"));
$year = substr(date("Y"),-2);
$index_number = sprintf("%04d", $id_num);
$id = $index_number . "/" . $id_type . "/" . $month . "/" . $year;
return $id;
}
if my question is not clear please ask