GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How do I convert the Microsoft Word apostrophe to an HTML friendly apostrophe? (https://gfy.com/showthread.php?t=862785)

zentz 10-17-2008 03:46 PM

How do I convert the Microsoft Word apostrophe to an HTML friendly apostrophe?
 
how do i convert ms word apostrophes to html friendly apostrophes in my WP and other mysql databases?

thank you

TheDoc 10-17-2008 03:52 PM

Replace them with: & #39 ;

zentz 10-17-2008 03:57 PM

which sql should i run?

GrouchyAdmin 10-17-2008 04:00 PM

update table set foo=replace(foo, 'bad', 'good');

farkedup 10-17-2008 04:11 PM

best tip is to not use MS word ;)

zentz 10-17-2008 04:13 PM

Quote:

Originally Posted by farkedup (Post 14915887)
best tip is to not use MS word ;)

thats the plan but i have to replace the existing ones

Sosa 10-17-2008 04:13 PM

Yeah, it sucks when text writers use word and then I throw it into dreamweaver and all the ' are fucked up

zentz 10-17-2008 04:17 PM

$20 epass to whoever gives me the correct query to execute.

FlexxAeon 10-17-2008 04:31 PM

Quote:

Originally Posted by GrouchyAdmin (Post 14915854)
update table set foo=replace(foo, 'bad', 'good');

give it to grouchy...

"table" = name of table
"foo" = field name
bad = that bad apostrophe
good = good apostrophe

Code:

UPDATE tablename SET fieldname = replace(fieldname, '*funky apostrophe here*', ''');
something like that

zentz 10-17-2008 04:39 PM

i tried this

update wp_posts set post_content = replace(post_content,'''', ''')

as funky apostrophe is showing as '' in mysql.

the error i get is:

ERROR: Unclosed quote @ 62
STR: '
SQL: update wp_posts set post_content = replace(post_content,'''', ''')

when i try to replace it with something else then ''' , example 'fuck' it works fine. any ideas?

GrouchyAdmin 10-17-2008 04:44 PM

You need to escape it. '\'' or '\"'.

FlexxAeon 10-17-2008 04:45 PM

Quote:

Originally Posted by zentz (Post 14915998)
i tried this

update wp_posts set post_content = replace(post_content,'''', ''')

as funky apostrophe is showing as '' in mysql.

the error i get is:

ERROR: Unclosed quote @ 62
STR: '
SQL: update wp_posts set post_content = replace(post_content,'''', ''')

when i try to replace it with something else then ''' , example 'fuck' it works fine. any ideas?

bah...my bad i was trying to edit my post and my boss walked in to talk lol...

dont use an actual apostrophe, use & #39 with space removed between & and 3

the funky apostrophe should carry over ok though if you copy/paste it directly from Word

FlexxAeon 10-17-2008 04:47 PM

or yeah escape it like grouchy just said (duh...forgot about that)

Code:

update wp_posts set post_content = replace(post_content,'*funky*', '\'');


All times are GMT -7. The time now is 12:28 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123