![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
Regular Coder ![]() Join Date: Aug 2002
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
strip the quotes...
Hi.. do u know an easy way for stripping some quotes from my database??.
For example "INSPEC IEE" This is a problem because this kind of entries are entered in my db as INSERT INTO Publishers VALUES (96,'\"INSPEC/IEE\"','\"INSPEC/IEE\"',' ....... The same problem appears when i also use the php to retrieve them. How i should remove the quotes from my db? Thx |
|
|
|
|
|
PM User | #2 | |
|
Regular Coder ![]() Join Date: Oct 2004
Location: UK
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
I am not clear on what you're asking. Do you want to remove the quote characters from data that is stored in the db tables, or strip them out of data that has been retrieved from the db by a script?
__________________
Quote:
|
|
|
|
|
|
|
PM User | #3 |
|
Regular Coder ![]() Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
php has a function called "stripslashes" which removes the escape characters from a string...
so just run that string from the query result through stripslashes($string), and hey presto, they're away
__________________
Questions are what binds the universe, Questions lead to answers, Answers lead to knowledge, Knowledge leads to wisdom, Wisdom brings more questions -- Horus Kol, 2004 :) |
|
|
|
|
|
PM User | #4 | |
|
Regular Coder ![]() Join Date: Oct 2004
Location: UK
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
That was my first thought too, but s/he consistently asks how to strip the quotes, not the slashes
__________________
Quote:
|
|
|
|
|
|
|
PM User | #6 |
|
Regular Coder ![]() Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
i don't know of a mysql command to strip the quote, but you can run a select and then update query and modify the data in php...
use strreplace("\", "", $string) to remove and quotes in a string.
__________________
Questions are what binds the universe, Questions lead to answers, Answers lead to knowledge, Knowledge leads to wisdom, Wisdom brings more questions -- Horus Kol, 2004 :) |
|
|
|
|
|
PM User | #7 |
|
Master Coder ![]() ![]() Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
just run:
UPDATE Publishers SET yourcolumn = REPLACE(yourcolumn,'\"','')
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
|
|
|
PM User | #8 |
|
Regular Coder ![]() Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
thanks raf - i learn something again today
__________________
Questions are what binds the universe, Questions lead to answers, Answers lead to knowledge, Knowledge leads to wisdom, Wisdom brings more questions -- Horus Kol, 2004 :) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|