Auto numbering on a non AUTO_INCREMENT field

For the sake of friendly url’s I am looking for a way to have auto numbering for a certain field. I have a table called videos. Within that table I have a field called url_string. So far the values in that field are:

video_001
video_002

video_055

and so on.

I am looking for a way to generate a next value when a new video is added. Any suggetions?

Thank you in advance

use an ordinary auto_increment column, then simply append its value to the string ‘video_’ upon retrieval with SELECT statements… or use a view which does this for you

Hi Rudi. Thanks for the reply. I will try that :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.