Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Sending a MySQL SET command via PHP from ZC code

    the information is stored in the database correctly,
    however the character set for server is Latin,
    I have verified that if I set that to utf8 that it will display your language correctly,
    Zen cart PCI compliant Hosting

  2. #2
    Join Date
    Mar 2006
    Location
    Greece
    Posts
    22
    Plugin Contributions
    0

    Default Re: Sending a MySQL SET command via PHP from ZC code

    We've found the way to send the command to mysql. I'm copying the modified code in includes/classes/db/mysql/query_factory.php, in case this helps other working with greek (or other languages for that matter):

    if ($zf_pconnect != 'false') {

    $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    mysql_select_db("database", $this->link);
    // change our character set
    mysql_query ('SET NAMES GREEK',$this->link);


    } else {

    // pconnect disabled ... leaving it as "connect" here instead of "pconnect"

    $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    mysql_select_db("database", $this->link);
    mysql_query ('SET NAMES GREEK',$this->link);


    the underlined lines force the client-side connection to mysql to translate to greek. store/admin now display greek ok, phpmyadmin was displaying ok to begin with, editing with php or Admin does not corrupt data.

    As this might help I'll recap our approach to having Greek display and edit correctlty. We've used two methods so far that have been successful and are evaluating the merits/possible problem of each. Both enable the store to display greek and the db to be viewable/editable through either phpmyadmin or navicat:

    1. create db, ALTER it to latin1/latin1_swedish_ci. import data from old backup through phpmyadmin specifying source file as latin. store/admin display greek if treated with iso override (had that in effect to enable the greek ZC translation to display greek correctly). phpmyadmin won't display correctly (as set up in our hosting environment) but navicat does. editing either via navicat or Admin does not corrupt data.

    2. create db, ALTER it to greek/greek_general_ci. import data from old backup through phpmyadmin specifying source file as greek. modify the code in includes/classes/db/mysql/query_factory.php (see above)

  3. #3
    Join Date
    Mar 2006
    Location
    Greece
    Posts
    22
    Plugin Contributions
    0

    Default Re: Sending a MySQL SET command via PHP from ZC code

    P.S. Imagine going through all the troble only to find the solution was in your lap all the time. I just (re-)discovered that the ZC code approach mentioned has been suggested to me in late March by dwno here at the forum. Thanks again dwno!

 

 

Similar Threads

  1. v153 subscribe and unsubscribe from email via zen_mail code
    By rebecca_L in forum General Questions
    Replies: 1
    Last Post: 2 Jun 2015, 03:08 AM
  2. Import Customers From CSV Via MySql?
    By suntower in forum Managing Customers and Orders
    Replies: 6
    Last Post: 15 Jun 2011, 06:54 AM
  3. php email not sending out with correct character set
    By mahalo in forum General Questions
    Replies: 5
    Last Post: 10 Jun 2007, 03:47 PM
  4. Set File Permissions from Command Line Help
    By Picci in forum General Questions
    Replies: 1
    Last Post: 20 Jan 2007, 03:00 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
  •  
disjunctive-egg