If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > changing </p> to nothing did not work...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-12, 00:54
Leafgreen Leafgreen is offline
Registered User
 
Join Date: Apr 2008
Posts: 36
changing </p> to nothing did not work...

I tried to run this query, but it did not change the </p> to a null value (in other words delete the </p>)
Code:
UPDATE xcart_products 
   SET descr = REPLACE(descr,'</p>','')
What's wrong with the query, please?
Reply With Quote
  #2 (permalink)  
Old 01-05-12, 03:07
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
becuase NULL isn't the same as ''

try
Code:
UPDATE xcart_products 
   SET descr = descr = '</p>' where descr = '' or descr is NULL;
however you may want to test the SQL does the right thing before committing such a change to actual data
so either run the update against a copy of your table or

Code:
select descr from xcart_products 
   where descr = '' or descr is NULL;
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 01-05-12, 03:13
Leafgreen Leafgreen is offline
Registered User
 
Join Date: Apr 2008
Posts: 36
The descr field values contain values that include </p>. I only want to delete </p> within the field values. So in other words:
record 1 = "aldsfj akldsjflas alksdjf </p> aldsjf aeldfjk"
I want to change record 1 to = "aldsfj akldsjflas alksdjf aldsjf aeldfjk"
Reply With Quote
  #4 (permalink)  
Old 01-05-12, 04:50
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by Leafgreen View Post
What's wrong with the query, please?
nothing

there must be some other reason
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On