Hafiz Abdullah
Hafiz Abdullah

Reputation: 248

remove empty space after new line in a string mysql

I have a field called "system" in my database which looks like this

system field;

registration    //This field is part of a table called "system_owner" 
elearning       //all three value is in one string which each contains "\n"
payment

When I removed the "elearning" with this SQL statement;

$SQL = "UPDATE system_owner SET system=REPLACE(system,'elearning','')

The system field became like this;

registration

payment

My problem is how do I remove the empty space between "registration" and "payment"? What SQL statement should I use?

The output of the field that I want

registration
payment

Upvotes: 0

Views: 375

Answers (1)

sushil
sushil

Reputation: 2671

What if you try:

$SQL = "UPDATE system_owner SET system=REPLACE(system,'elearning\n','')

Upvotes: 4

Related Questions