3 Replies - 559 Views - Last Post: 28 June 2009 - 09:15 PM Rate Topic: -----

#1 ChrisPontiac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-June 09

How to delete all instances of a characters from all rows

Posted 28 June 2009 - 04:08 AM

Hello,

I can't seem to figure out how to remove all of the instances of a characters from every row.

For the example below I want to remove all of the $ characters from all rows.

Example row:
Row 1: The War of Rose$
Row 2: Mi$$i$$ippi
Row 3: Cowboy$

I've tried DELETE FROM table WHERE title=$, UPDATE table SET title='' WHERE title='$'. And none of them worked.

Thanks for your help.

Is This A Good Question/Topic? 0
  • +

Replies To: How to delete all instances of a characters from all rows

#2 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: How to delete all instances of a characters from all rows

Posted 28 June 2009 - 04:20 AM

Science i Know you can't do it with a query but you can do it with PHP.
str_replace
$value = 'Mi$$i$$ippi';
$value1 = str_replace("$","",$value);
echo $value1;

This post has been edited by noorahmad: 28 June 2009 - 09:15 PM

Was This Post Helpful? 0
  • +
  • -

#3 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: How to delete all instances of a characters from all rows

Posted 28 June 2009 - 02:28 PM

For quick reference, if you put Mi$$i$$ippi in single quotes instead of double quotes when you declare the value, you won't have to escape the dollar signs.

This post has been edited by Valek: 28 June 2009 - 02:29 PM

Was This Post Helpful? 0
  • +
  • -

#4 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: How to delete all instances of a characters from all rows

Posted 28 June 2009 - 09:15 PM

Thank You.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1