Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: mysql remove spaces and single quotes from string

  1. #11
    Join Date
    Jan 2015
    Thanked 19 Times in 19 Posts


    Sorry to jump in here, but what you are showing for code isn't how you would display product information on a web page (you wouldn't have individual .php files and you would use the item id (auto-increment integer) value from a product database table to reference/request the data to display through a single .php file) and you have mentioned database code (btw - phpmyadmin is not a database server it's a php scrip that's used to manage a mysql database) not working but haven't shown any code for this.

    There's also two problems with this - mysql_query("set names 'utf8'"); The php mysql_ extension is obsolete and executing a set names ... query doesn't set the character set used for the connection, it just tells the db server what character set it should expect the connection to use. You should switch to use the php PDO extension, where you can set the character set used for the connection when you make the connection.

    Mod's Note:
    By all means jump in. You probably know more about the mysql/php side of this than I do. It's obviously an encoding issue though. From what I can tell, the text displayed on the page is not matching the filenames. But the OP hasn't even shown us that much for certain. If that's all that it is, however, the page simply needs to be served in UTF-8 - many server emulators still do ISO by default. It could be the page or the server itself (we can't really see the required detail in the images). In any case, just getting everything doing everything in UTF-8 is likely the solution.
    Last edited by jscheuer1; 12-25-2016 at 06:48 AM. Reason: add info

  2. #12
    Join Date
    Nov 2016
    Thanked 0 Times in 0 Posts


    Hello, sorry for the late reply but the holidays you know.
    I am new to php and my English is not that good so to do a lot of reading would take forever, that why I try to learn by making something for a family member.

    The problem with some pages that did not open had to do with single quotation mark ' in a query should be '' .

    For now everything works and I move on the the next problem.

    Thank you all and have a great 2017!!

Similar Threads

  1. mySQL Single Quote Issue
    By jdadwilson in forum MySQL and other databases
    Replies: 1
    Last Post: 07-24-2013, 01:11 AM
  2. how to remove this string using regex
    By smansakra in forum PHP
    Replies: 16
    Last Post: 08-28-2011, 06:55 PM
  3. Remove Spaces Between Tabs (Tab Content script v2.2)
    By vlane95678 in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-16-2009, 11:40 PM
  4. remove html comments from string
    By IRG in forum JavaScript
    Replies: 1
    Last Post: 11-01-2008, 04:02 AM
  5. single quotes & double quotes insert into mysql
    By shyne in forum MySQL and other databases
    Replies: 3
    Last Post: 11-25-2007, 09:18 PM


Posting Permissions

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