I am developing invoice template.Can anyone suggest me how to auto-increment invoice number which may be alphanumeric number like "aaaa123","awrewr11"...........
$x = "abc123";
Should read abc124.
In a word. Don't.
More often that not, it's only ever used when presenting the data. Use a regular incrementing key and build the reference as required.
) AS reference FROM table;