This is a discussion on MySql, PHP and Encoding within the MySQL forums, part of the Database Server Software category; --> 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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 charset 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 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 charset 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 charsets are just used for collation (sorting) non-equal comparisons. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
| |||
| 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 charsets 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 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 charsets 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. |
| |||
| 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 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. jstucklex@attglobal.net ================== |
| Thread Tools | |
| Display Modes | |
|
|