Insert Symbol into Mysql
am 16.09.2009 13:30:31 von Samrat Kar
------=_NextPart_000_0081_01CA36EF.3B5154F0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
I want to insert symbols like degree, plusminus, currency along with string
into Mysql database. Front is HTML form with javascript. Server side scripts
are written in PHP. Please help.
Regards,
Samrat Kar
------=_NextPart_000_0081_01CA36EF.3B5154F0--
RE: Insert Symbol into Mysql
am 16.09.2009 13:41:25 von Andrea Giammarchi
--_45667376-9e28-4d4e-9d1e-d87e4525eb69_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
does JavaScript use the proper way to encode strings as encodeURIComponent =
is=2C and for each sent key/value pair?
Is MySQL table charset ut8_general_ci ?
If not=2C do you convert sent UTF-8 charset into table charset?
In few words we miss the way/library used to send data=2C the default PHP c=
harset=2C the MySQL table charset=2C the way you store/retrieve data into M=
ySQL=2C etc etc ... we can help but we need more info
> From: esamrat@barc.gov.in
> To: php-general@lists.php.net
> Date: Wed=2C 16 Sep 2009 17:00:31 +0530
> Subject: [PHP] Insert Symbol into Mysql
>=20
> I want to insert symbols like degree=2C plusminus=2C currency along with =
string
> into Mysql database. Front is HTML form with javascript. Server side scri=
pts
> are written in PHP. Please help.
>=20
> =20
>=20
> Regards=2C
>=20
> =20
>=20
> Samrat Kar
>=20
____________________________________________________________ _____
With Windows Live=2C you can organize=2C edit=2C and share your photos.
http://www.microsoft.com/middleeast/windows/windowslive/prod ucts/photo-gall=
ery-edit.aspx=
--_45667376-9e28-4d4e-9d1e-d87e4525eb69_--
Re: Insert Symbol into Mysql
am 16.09.2009 13:41:55 von Ashley Sheridan
On Wed, 2009-09-16 at 17:00 +0530, Samrat Kar wrote:
> I want to insert symbols like degree, plusminus, currency along with stri=
ng
> into Mysql database. Front is HTML form with javascript. Server side scri=
pts
> are written in PHP. Please help.
>=20
> =20
>=20
> Regards,
>=20
> =20
>=20
> Samrat Kar
>=20
Two ways to do this:
1. Insert the characters as their escaped HTML codes, e.g. °
± £ (for °, ± and £)
2. Set the DB to use a utf8 character set, and insert the
characters directly as is, without escaping them
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Insert Symbol into Mysql
am 16.09.2009 14:47:39 von Andrea Giammarchi
--_efca52f8-e3a5-49fd-b1f8-51a76fe8abab_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
He has no utf-8 charset in the table=2C so the first point is valid and htm=
lentities is the function ( http://uk.php.net/manual/en/function.htmlentiti=
es.php )
You need to remember that in this way you need to use htmlentities for *eve=
rything*=2C specially for searches=2C otherwise ° against °=3B will b=
e a "not found".
Alternative could be mb_string for charset manipulation but since the table=
is not UTF-8 you could have lots of problems with other chars ... so you c=
hange the charset if this is a new project before you gonna be in trouble f=
or size and/or performances=2C or you convert each stored stirng via htmlen=
tities and you start right now to use htmlentities as default select/insert=
"parser" (or you convert everything into utf-8 via mb_string and you trunc=
ate the table=2C change the charset=2C refill it via converted values perfo=
rmed into another table)
Regards
> From: ash@ashleysheridan.co.uk
> Two ways to do this:
>=20
> 1. Insert the characters as their escaped HTML codes=2C e.g. °=
=3B
> ±=3B £=3B (for °, =B1 and =A3)
> 2. Set the DB to use a utf8 character set=2C and insert the
> characters directly as is=2C without escaping them
____________________________________________________________ _____
Share your memories online with anyone you want.
http://www.microsoft.com/middleeast/windows/windowslive/prod ucts/photos-sha=
re.aspx?tab=3D1=
--_efca52f8-e3a5-49fd-b1f8-51a76fe8abab_--
RE: Insert Symbol into Mysql
am 16.09.2009 14:55:11 von Ashley Sheridan
--=-KZQJ+BsZRTRCxxjo6cz/
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Wed, 2009-09-16 at 14:47 +0200, Andrea Giammarchi wrote:
> He has no utf-8 charset in the table, so the first point is valid and htm=
lentities is the function ( http://uk.php.net/manual/en/function.htmlentiti=
es.php )
> You need to remember that in this way you need to use htmlentities for *e=
verything*, specially for searches, otherwise ° against ° will be=
a "not found".
>=20
> Alternative could be mb_string for charset manipulation but since the tab=
le is not UTF-8 you could have lots of problems with other chars ... so you=
change the charset if this is a new project before you gonna be in trouble=
for size and/or performances, or you convert each stored stirng via htmlen=
tities and you start right now to use htmlentities as default select/insert=
"parser" (or you convert everything into utf-8 via mb_string and you trunc=
ate the table, change the charset, refill it via converted values performed=
into another table)
>=20
> Regards
>=20
> > From: ash@ashleysheridan.co.uk
> > Two ways to do this:
> >=20
> > 1. Insert the characters as their escaped HTML codes, e.g. °
> > ± £ (for °, ± and £)
> > 2. Set the DB to use a utf8 character set, and insert the
> > characters directly as is, without escaping them
>=20
> ____________________________________________________________ _____
> Share your memories online with anyone you want.
> http://www.microsoft.com/middleeast/windows/windowslive/prod ucts/photos-s=
hare.aspx?tab=3D1
I don't recall him saying that a utf8 table was not an option or that he
wasn't using one.
Also, try not to top post ;)
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-KZQJ+BsZRTRCxxjo6cz/--
Re: Insert Symbol into Mysql
am 16.09.2009 15:16:43 von joao
If he´s really using a any other charset instead of utf8 table, why not
using utf8_decode and utf8_decode in his php files to solve this?
"Ashley Sheridan" escreveu na mensagem
news:1253101315.2275.4.camel@localhost...
On Wed, 2009-09-16 at 17:00 +0530, Samrat Kar wrote:
> I want to insert symbols like degree, plusminus, currency along with
> string
> into Mysql database. Front is HTML form with javascript. Server side
> scripts
> are written in PHP. Please help.
>
>
>
> Regards,
>
>
>
> Samrat Kar
>
Two ways to do this:
1. Insert the characters as their escaped HTML codes, e.g. °
± £ (for °, ± and £)
2. Set the DB to use a utf8 character set, and insert the
characters directly as is, without escaping them
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Insert Symbol into Mysql
am 16.09.2009 15:40:23 von Andrea Giammarchi
--_088fb55d-d3f4-4025-bf5e-6d2ac3fd66d1_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
> I don't recall him saying that a utf8 table was not an option or that he
> wasn't using one.
I know 'cause he replied directly to me rather than this ML
>=20
> Also=2C try not to top post =3B)
I usually hate scroll 'till the end to find often a single row as reply ...=
I'll try though
>=20
> Thanks=2C
> Ash
> http://www.ashleysheridan.co.uk
>=20
Thanks
____________________________________________________________ _____
Drag n=92 drop=97Get easy photo sharing with Windows Live=99 Photos.
http://www.microsoft.com/windows/windowslive/products/photos .aspx=
--_088fb55d-d3f4-4025-bf5e-6d2ac3fd66d1_--
RE: Insert Symbol into Mysql
am 16.09.2009 15:41:11 von Ashley Sheridan
On Wed, 2009-09-16 at 15:40 +0200, Andrea Giammarchi wrote:
> > I don't recall him saying that a utf8 table was not an option or that h=
e
> > wasn't using one.
>=20
> I know 'cause he replied directly to me rather than this ML
>=20
> >=20
> > Also, try not to top post ;)
>=20
> I usually hate scroll 'till the end to find often a single row as reply .=
... I'll try though
>=20
>=20
> >=20
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >=20
>=20
> Thanks
>=20
> ____________________________________________________________ _____
> Drag nâ=99 dropâ=94Get easy photo sharing with Windows Live=E2=
¢ Photos.
>=20
> http://www.microsoft.com/windows/windowslive/products/photos .aspx
Yeah, the rules say to snip out parts of the convo which aren't
pertinent, but I know I don't exactly follow that one either! :-/
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Insert Symbol into Mysql
am 16.09.2009 15:42:39 von Andrea Giammarchi
--_67ffbfa4-6086-40c3-ae2f-91581b3cd82e_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> If he=B4s really using a any other charset instead of utf8 table=2C why n=
ot=20
> using utf8_decode and utf8_decode in his php files to solve this?
let's say PHP could have a different charset than the one defined in that M=
ySQL table so this is not a portable solution=2C specially if you do not pe=
rfectly know charset and problems.
Regards
____________________________________________________________ _____
Show them the way! Add maps and directions to your party invites.=20
http://www.microsoft.com/windows/windowslive/products/events .aspx=
--_67ffbfa4-6086-40c3-ae2f-91581b3cd82e_--
RE: Insert Symbol into Mysql
am 16.09.2009 15:44:31 von Andrea Giammarchi
--_ea951571-311c-4234-94e9-23d443284137_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> Yeah=2C the rules say to snip out parts of the convo which aren't
> pertinent=2C but I know I don't exactly follow that one either! :-/
>=20
> Thanks=2C
> Ash
> http://www.ashleysheridan.co.uk
to be honest the problem is that I am in hotmail rather than gmail here=2C =
and this page is not clever as gmail one is=2C quotes/replies are quite ann=
oying here.
Thanks
____________________________________________________________ _____
Share your memories online with anyone you want.
http://www.microsoft.com/middleeast/windows/windowslive/prod ucts/photos-sha=
re.aspx?tab=3D1=
--_ea951571-311c-4234-94e9-23d443284137_--