SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Having trouble with a find and replace mysql php script

    I'm looking for some help please. I don't understand why this doesn't work

    I can't get the following scrpt to work if I put it in a php file:

    $queryfix = "UPDATE Stock SET Model = replace(Model, '', 'é')";
    mysql_query($queryfix) or die(mysql_error());

    But when I use phpmyadmin to run the sql query it works!

    I've even tried using the phpmyadmin to create the php script but it throws up errors when I run it.

    Can anyone help please?

    Thanks in advance

  2. #2
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Figured it out!
    I've pasted below what worked for me incase it helps anyone else!

    mb_convert_encoding($data,'ISO-8859-15','utf-8');


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •