Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

run column2 through a function and output would be in column3

using mysqli, or pdo

I would like a php function that prepends 'begin' and postpends 'end' to an existing varchar field

table.column1 int primary key autoincrement
table.column2 varchar
table.column3 varchar


example output
5454  begin5454end
656    begin656end
4        begin4end
A        beginAend
ASKER CERTIFIED SOLUTION
Avatar of Cornelia Yoder
Cornelia Yoder
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

yes that works using only mysql.
Thank you.
I guess you could write a function, but it might be easier to write a single line PHP statement like this:

$old = '5454';
$new = 'begin' . $old . 'end';