Professional Web Applications Themes

MySql, PHP and Encoding - MySQL

Hi, I'm using mysql 4.0.18 on a web server with PHP 5.1.1 and I'm trying to pass from the iso-8859-1 encoding to utf8, but I'm still confused about many questions. With which encoding data is saved in the DB when data is generated by PHP? Does it depend to the cht of the php page? And if the string is inserted in a page by the user in a form and then inserted in the database? There is any setting of mysql, or any property of the db, of the table or of the field? Thank you, Carlo....

  1. #1

    Default MySql, PHP and Encoding

    Hi, I'm using mysql 4.0.18 on a web server with PHP 5.1.1 and I'm trying to
    pass from the iso-8859-1 encoding to utf8, but I'm still confused about
    many questions.

    With which encoding data is saved in the DB when data is generated by PHP?
    Does it depend to the cht of the php page? And if the string is
    inserted in a page by the user in a form and then inserted in the database?

    There is any setting of mysql, or any property of the db, of the table or
    of the field?

    Thank you,
    Carlo.
    Carlone Guest

  2. #2

    Default Re: MySql, PHP and Encoding

    Carlone wrote:
    > Hi, I'm using mysql 4.0.18 on a web server with PHP 5.1.1 and I'm trying to
    > pass from the iso-8859-1 encoding to utf8, but I'm still confused about
    > many questions.
    >
    > With which encoding data is saved in the DB when data is generated by PHP?
    > Does it depend to the cht of the php page? And if the string is
    > inserted in a page by the user in a form and then inserted in the database?
    >
    > There is any setting of mysql, or any property of the db, of the table or
    > of the field?
    >
    > Thank you,
    > Carlo.
    Carlo,

    MySQL stores whatever PHP (or any other program) tells it to store. It
    does not change the encoding of the data. The chts are just used
    for collation (sorting) non-equal comparisons.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  3. #3

    Default Re: MySql, PHP and Encoding

    Il Sat, 22 Jul 2006 10:51:04 -0400, Jerry Stuckle ha scritto:
    > Carlo,
    >
    > MySQL stores whatever PHP (or any other program) tells it to store. It
    > does not change the encoding of the data. The chts are just used
    > for collation (sorting) non-equal comparisons.
    Ok, thanks, I think i understood..
    Another question: so the data that is inserted in the DB has the encoding
    of the php page? Both if it comes directly from php code or from an input
    form?
    Carlone Guest

  4. #4

    Default Re: MySql, PHP and Encoding

    Carlone wrote:
    > Il Sat, 22 Jul 2006 10:51:04 -0400, Jerry Stuckle ha scritto:
    >> Carlo,
    >>
    >> MySQL stores whatever PHP (or any other program) tells it to store.
    >> It does not change the encoding of the data. The chts are just
    >> used for collation (sorting) non-equal comparisons.
    >
    > Ok, thanks, I think i understood..
    > Another question: so the data that is inserted in the DB has the
    > encoding of the php page? Both if it comes directly from php code or
    > from an input form?
    There isn' treally a php page. There is an HTML page, which may be generated
    by php. What Jerry meant was that PHP or any other program passes a string
    of bits to MySQL and that it what MySQL stores. View that data through an
    interface that assumes different encoding and you will see different things.


    Paul Lautman Guest

  5. #5

    Default Re: MySql, PHP and Encoding

    Il Sat, 22 Jul 2006 22:18:07 +0100, Paul Lautman ha scritto:
    > There isn' treally a php page. There is an HTML page, which may be generated
    > by php. What Jerry meant was that PHP or any other program passes a string
    > of bits to MySQL and that it what MySQL stores. View that data through an
    > interface that assumes different encoding and you will see different things.
    Ok, but if i insert in a table, using a php application, some data taken
    from an input form, that data has the same encoding of the html page of the
    sending form or it depends also on some settings of the user's browser or
    os?

    Carlo.
    Carlone Guest

  6. #6

    Default Re: MySql, PHP and Encoding

    Carlone wrote:
    > Il Sat, 22 Jul 2006 22:18:07 +0100, Paul Lautman ha scritto:
    >
    >>There isn' treally a php page. There is an HTML page, which may be generated
    >>by php. What Jerry meant was that PHP or any other program passes a string
    >>of bits to MySQL and that it what MySQL stores. View that data through an
    >>interface that assumes different encoding and you will see different things.
    >
    >
    > Ok, but if i insert in a table, using a php application, some data taken
    > from an input form, that data has the same encoding of the html page of the
    > sending form or it depends also on some settings of the user's browser or
    > os?
    >
    > Carlo.
    Carlo,

    You should ask about this in an html group such as alt.html. Data
    transferred between the client and the server have nothing to do with
    either PHP or a database.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

Similar Threads

  1. Replies: 2
    Last Post: February 14th, 10:54 AM
  2. Replies: 1
    Last Post: January 23rd, 12:06 PM
  3. Replies: 0
    Last Post: January 29th, 02:03 PM
  4. Forms, Character Encoding, and MySQL
    By Duality.Enigma in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: October 21st, 12:19 AM
  5. UTF Encoding
    By koeniga in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: April 27th, 06:28 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139