0

i have a column name fighters which include some value in mysql such as,

| fighters |

| Rock |

| John Cena, |

| UnderTaker,|

So, I want when i Display it in a browser it should appear like

Rock

John Cena

UnderTaker

I just want to remove commas from database using PHP

Any Help will be appreciated..

1
  • do you have instances that a comma exists between words? example John, Cena, Commented Apr 26, 2013 at 7:37

2 Answers 2

3

Give

str_replace(",","",$str);
Sign up to request clarification or add additional context in comments.

Comments

2

Use REPLACE() in the SQL query

SELECT REPLACE(fighters, ',', '') FROM  table 

Though why you'd want to do this in query rather than stripping it on the php side if beyond me

2 Comments

It doesn't specify anywhere that it has to be done with MySQL
...but there is the mysql tag on the question, so it is certainly appropriate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.