Add an auto-increment primary key, say id, to the table, then create the customer_id column as a
Generated Column[
^] the value of which derives from
concatenating[
^] the 'c_' with the primary key value.
+++++++++[Edit]+++++++++
Ok, try this.
1. Create a new table, say 'dummy', with only one auto-increment primary key column called id.
2. Every time you need a new customer id upon clicking a button, insert a null value to this table like this:
insert into dummy set id=null
or
insert into dummy values (null)
3. step 2 will generate a new unique id, retrieve this id using
PHP mysqli_insert_id() Function[
^] and concatenate it with other prefix, say 'c_', to get a unique customer id.
In this way, you are certain that no two users get the same customer id.