Jump to content


Photo

Importing Issue ’


  • Please log in to reply
4 replies to this topic

#1 oMIKEo

oMIKEo
  • Members
  • PipPip
  • Member
  • 19 posts
  • LocationLeeds, UK

Posted 12 April 2006 - 03:37 PM

Hi,

Ive been importing all the records for a clients site into my database and ive just exported and then imported them into the clients database but its not working very well...

Its adding things like don’t when it should be a '

Any ideas if i can easily solve this?

Thanks,
Mike

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 April 2006 - 03:55 PM

Is the data being stored via Microsoft word? If so, what looks like a simple quote ( ' ) really isn't one.

Ken

#3 oMIKEo

oMIKEo
  • Members
  • PipPip
  • Member
  • 19 posts
  • LocationLeeds, UK

Posted 12 April 2006 - 04:09 PM

The data was originally in MS Word then pasted into my database via phpmyadmin.

From that the tables and data were extracted as a .sql file and imported into the clients database, again via phpmyadmin.

Any ideas how to fix the problem of those special characters.

Thanks

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 April 2006 - 04:56 PM

I found this solution on another PHP email list I'm on:
<?php
     $search = array(
         '/[\x07\x95]/',
         '/\x85/',
         '/[\x91\x92]/',
         '/[\x93\x94]/',
     );
     $replace = array(
         '-',
         '...',
         '\'',
         '"',
     );
     $data = preg_replace($search, $replace, $data);
?>

Ken

#5 oMIKEo

oMIKEo
  • Members
  • PipPip
  • Member
  • 19 posts
  • LocationLeeds, UK

Posted 12 April 2006 - 05:08 PM

Thanks,

Problem Fixed :)

Mike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users