I have a mySQL table with alot of links like this:
id - link
1 | index.php?video=12
2 | index.php?video=345
3 | index.php?video=6789
4 | index.php?video=123&other=variable
5 | www.site.com/index.php?video=456&other=variable
One link per text row. I would like to add zeros before the numbers but it has to be nine numbers in total. so video=12 would be video=000000012 and video=6789 would be video=000006789.
Is there some way to acheive this by using SQL query?
EDIT: the solution tombom submitted worked fine but what if I have links that don't have the video=x variable?