Need Help Stringing Some Php Commands Together

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Wed Oct 03, 2012 9:04 am

it's not as readable, but you can nest your replace statements so that the return of one is used as the primary string for the next. luckily since whitespace doesn't matter your code can kind of reflect the nesting so it's easier to keep track of. here's an example doing 3 replacements in one line.

Code: Select all

UPDATE 'property'  SET 'description' = replace(
												replace('description',"é", "e")
											,"á", "a"),
										"St.", "St ");

fixed typo

Post Reply