Mysql Arabic table WhicH i want to excell/csv

Discussion in 'PHP' started by peterman7, Dec 5, 2012.

  1. #1
    Hello
    I have mysql tables where the text is arabic, I want to export them to Excell, If this is not possible , then to csv and then to excell,

    How I can do that, I have the phpmyadmin, It is not necessary that I do it through php, but if there is no other choice, i will do it through php

    I have written php code, but the result is that the arabic gives me ????


    Help is appreciated

    The codes are atttached in csv and excell approach

     

    Attached Files:

    peterman7, Dec 5, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    have you set the html meta content type tag? if not, please search with these words and you'll find your solution!
     
    EricBruggema, Dec 5, 2012 IP
  3. peterman7

    peterman7 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Ive done all this:
    @mysql_query('SET NAMES utf8');
    @mysql_query("SET CHARACTER SET 'utf-8'");
    AND
    header("Content-Type: text/x-csv; chartset=utf-8");
    header("Content-Disposition: attachment; filename=file.csv");
     
    peterman7, Dec 5, 2012 IP
  4. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #4
    Vooler, Dec 22, 2012 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    A sample csv file would probably be of help here. I suspect that the file in which you see ??? for Arabic characters is actually correct, but the program you're looking at the file with isn't displaying Arabic.

    Computers don't store "Arabic characters", they store a utf character designation, which is really just a number. That same number is used for all character sets. The difference is that when the program is told "display this file as Arabic characters", you see Arabic characters. If the program is designed to read ASCII characters, most foreign characters look like junk and are displayed as question marks or graphic characters (depending on the program).
     
    Rukbat, Dec 22, 2012 IP