Other Tools By Katy: Code Snippets | Writing Progress Tracker | Threader: Easy Threads Maker | Word Cloud Maker

Remove First Character From A Field In A Database

Assuming we have the following entry in our database:

/go/123456

But we require:

go/123456

UPDATE `TABLENAME` 
SET `FIELDNAME` = SUBSTRING(`FIELDNAME`, 2) 
WHERE `FIELDNAME` LIKE `/%`;
Disclaimer: The code on this website is provided "as is" and comes with no warranty. The author of this website does not accept any responsibility for issues arising from the use of code on this website. Before making any significant changes, ensure you take a backup of all files and do not work directly on a live/production website without thoughly testing your changes first.

Leave a Reply

Your email address will not be published. Required fields are marked *