$public_prod_id = "C".rand(1000000000,9999999999);
$_SESSION["public_prod_id"] = $public_prod_id;
$exist = mysqli_num_rows($pdo->query(
"SELECT * FROM `product`
WHERE `public_prod_id` = "{$_SESSION["public_prod_id"]}" "
));
if($exist == 0){
$pdo->query(
"INSERT INTO ``
(
``
)
VALUES
(
"{}"
)
"
);
}
if the result found is greater than 0
, how can I go back to it and generate a new set of codes and then walk again?