Page 1 of 2 12 LastLast
Results 1 to 10 of 36

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Posts
    12
    Plugin Contributions
    0

    help question ability to define DB_CHARSET in v1.3.9?

    hello all
    i see in the new version that :
    Code:
    Added ability to define DB_CHARSET to automatically trigger a mysql SET NAMES statement if needed for things like UTF8 support, preventing the need to edit the db class
    so where should i define this???

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: ability to define DB_CHARSET ?

    Create a new file for it:

    /includes/extra_configures/my_db_charset.php
    Code:
    <?php define('DB_CHARSET', 'your_charset_here');
    Do the same with: /admin/includes/extra_configures/my_db_charset.php


    NOTES:
    - This is only applicable to v1.3.9x. It will NOT work in older versions, and is not applicable to the future versions after v1.5.0 since they will be utf8 already.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    I had to add this line of code when I upgraded to php 5 [ZenCart 138 code doesn't set the encoding of the client connection, so when connecting to a MySQL 5 server, the server will return utf-8 encoded text.]
    PHP Code:
    the code added to includes/classes/db/mysql/query_factory.php line 36:

        
    mysql_set_charset('latin1'); 
    Should I keep this or go with the new code
    PHP Code:
    /includes/extra_configures/my_db_charset.php <?php define('DB_CHARSET''your_charset_here');
    I plan to upgrade this week to 1.39a
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: ability to define DB_CHARSET ?

    Using the DB_CHARSET define replaces the need for editing query_factory.php, so you should remove your custom code from that file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    thanks dr byte!
    Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

  6. #6
    Join Date
    Nov 2009
    Posts
    12
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    thank you

  7. #7
    Join Date
    Jul 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    Quote Originally Posted by DrByte View Post
    Create a new file for it:

    /includes/extra_configures/my_db_charset.php
    Code:
    <?php define('DB_CHARSET', 'your_charset_here');
    Do the same with: /admin/includes/extra_configures/my_db_charset.php


    NOTES:
    - This is only applicable to v1.3.9x. It will NOT work in older versions, and is not applicable to the future version v2.x since it will be utf8 already.
    Hi all,

    this worked perfectly for German with utf8 and the '?>' at the end of the php file.

    Many thanks to all

    Regards,

    Jack

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: ability to define DB_CHARSET ?

    Quote Originally Posted by tweedle View Post
    and the '?>' at the end of the php file.
    Jack, that '?>' is not necessary: https://www.zen-cart.com/tutorials/i...hp?article=313
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jun 2009
    Posts
    11
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    Hi all. I have been successfully using Zen Cart for 2 years now....Me and my wife work at it full time, doing an online bicycle shop.

    Anyway, I am about to build a separate shop and am trying to get the UTF-8 settings sorted.

    I have 1.3.9 and so do not need to modify query_factory.php

    I just can not understand what I am meant to do instead.... sorry for being so ignorant. I just find the instructions on this thread too brief/vague to get my head around.

    ----
    Here are my questions regarding DRBYTES post/instructions....

    ----
    DrByte said//

    Create a new file for it: (((I do this by making a new file in smultron or text editor?)))

    /includes/extra_configures/my_db_charset.php
    Code:

    <?php define('DB_CHARSET', 'your_charset_here'); (((so I type UTF-8 in this space between the apostrophes?)))

    Do the same with: /admin/includes/extra_configures/my_db_charset.php

    ------
    I hope that makes sense.....

  10. #10
    Join Date
    Aug 2004
    Location
    Osaka Japan
    Posts
    163
    Plugin Contributions
    0

    Default Re: ability to define DB_CHARSET ?

    Quote Originally Posted by DrByte View Post
    Create a new file for it:

    /includes/extra_configures/my_db_charset.php
    Code:
    <?php define('DB_CHARSET', 'your_charset_here');
    Do the same with: /admin/includes/extra_configures/my_db_charset.php


    NOTES:
    - This is only applicable to v1.3.9x. It will NOT work in older versions, and is not applicable to the future version v2.x since it will be utf8 already.
    Created and uploaded as outlined, the result is a DB collation of latin1_general_ci in the tables, I am now manually changing each field. Adding the 2 files causes the store and admin screen to go blank. I'm not clear why I had this problem.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 CHARSET / DB_CHARSET: Valid combinations?
    By lat9 in forum General Questions
    Replies: 2
    Last Post: 5 Feb 2016, 02:43 PM
  2. Diamond characters and I tried defining DB_CHARSET
    By lruskauff in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 14 Jan 2014, 06:23 AM
  3. Define Pages - How to define brand new page
    By hutch32804 in forum Customization from the Admin
    Replies: 4
    Last Post: 31 Oct 2009, 01:39 PM
  4. Uploading Ability?
    By wildkeith in forum General Questions
    Replies: 2
    Last Post: 22 Nov 2008, 04:59 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR