View Full Version : strip the quotes...
alaios
01-11-2005, 12:47 PM
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
Sayonara
01-11-2005, 12:54 PM
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?
Horus Kol
01-11-2005, 02:39 PM
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
Sayonara
01-11-2005, 02:42 PM
That was my first thought too, but s/he consistently asks how to strip the quotes, not the slashes :confused:
alaios
01-11-2005, 05:50 PM
thx for your answers... I want to remove the quotes from the database
Horus Kol
01-12-2005, 10:51 AM
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.
just run:
UPDATE Publishers SET yourcolumn = REPLACE(yourcolumn,'\"','')
Horus Kol
01-12-2005, 12:36 PM
thanks raf - i learn something again today :)
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.