从php编辑表中的字段[复制]

This question already has an answer here:

Good afternoon, I hope you can help me, I need to update the values ​​of an entire column, I have a column called "img" in which I have:

../img/user/000001.jpg 

I would like to modify it so that only left:

000001.jpg 

users to update I occupy this code:

<?php
include("config.php");
mysql_query("UPDATE images SET user = 'new_user' WHERE user = 'user'");
mysql_close($conexion);
?>

but now I feel the need to update the path to the images, but they are more than 5000 and I want to do with php to save time.

I just need to remove the first 12 characters of the "img" column, as I can do this with php?

Thank you very much in advance.

</div>

PHP isn't necessary for this, it can be done in pure SQL

UPDATE images SET img = SUBSTRING(img, 13, LENGTH(img) - 12)
WHERE SUBSTRING(img, 1, 12) = '../img/user/'