Connecting Tech Pros Worldwide Help | Site Map

nonstandard symbols: function to replace?

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 21st, 2005, 11:05 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a
Default nonstandard symbols: function to replace?

Hey all.

Some of my writers are submitting stuff they've typed into Word (ughh),
meaning we get annoying symbols instead of " and '. I know I can build
a search and replace into my submissions form to stop these at the
source, but I don't want to run this through the existing 500 articles.
Is there some kind of method or function to display these? My
database-pulled content just displays a ? for them at the moment.

Matt


  #2  
Old November 21st, 2005, 11:05 PM
Toby Inkster
Guest
 
Posts: n/a
Default Re: nonstandard symbols: function to replace?

guitarromantic wrote:
[color=blue]
> but I don't want to run this through the existing 500 articles.[/color]

Why not?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

  #3  
Old November 21st, 2005, 11:05 PM
guitarromantic@gmail.com
Guest
 
Posts: n/a
Default Re: nonstandard symbols: function to replace?

Because I'd have to manually go through each one and process it through
the system..? Or are you suggesting I run it into phpMyAdmin or
something and just do a global replace? That could work.

  #4  
Old November 21st, 2005, 11:05 PM
chotiwallah
Guest
 
Posts: n/a
Default Re: nonstandard symbols: function to replace?


guitarromantic@gmail.com wrote:[color=blue]
> Because I'd have to manually go through each one and process it through
> the system..? Or are you suggesting I run it into phpMyAdmin or
> something and just do a global replace? That could work[/color]

best idea in my opinion would be to clean up before putting the stuff
into the database. once you have that clean up script, i'd adapt it to
run it over the 500 articles once and for all.

micha

  #5  
Old November 21st, 2005, 11:05 PM
Toby Inkster
Guest
 
Posts: n/a
Default Re: nonstandard symbols: function to replace?

guitarromantic wrote:
[color=blue]
> Because I'd have to manually go through each one and process it through
> the system..?[/color]

Please quote the post you're replying to so that people know what you're
talking about.

No need to do it manually! Say you have a function "fixsymbols()" that can
fix the symbols, simply create a script like this:

$r = mysql_query("SELECT articleid, content FROM articles;");
while ($a = mysql_fetch_array($r))
{
$id = $a[0];
$content = addslashes(fixsymbols($a[1]));
$q = "UPDATE articles SET content='$content' WHERE articleid='$id';";
mysql_query($q);
}

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.