469,612 Members | 2,658 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Inserting and retrieveing special characters in Mysql using php

Hello everybody,
My question is how to insert special characters and symbols in Mysql5 database and how to retrieve them from database in php.
Here i am inserting some data from a form,by post method like
[PHP]$data=$_post[''field name"];[/PHP]
after this i am inserting in database,
[PHP]mysql_query("insert into tbl_name(column name) values('$data')");[/PHP]
Everthing working fine when we insert simple text in the form,but failing when special character are entered. eg: "",&,("some text").
And onemore thing i want to insert some mathematical equations or chemical equations into database how?
Mar 10 '08 #1
2 5346
ronverdonk
4,258 Expert 4TB
Have you used the[php]mysql_escape_string()[/php] command on the $data variable before inserting?

Ronald
Mar 10 '08 #2
Markus
6,050 Expert 4TB
Have you used the[php]mysql_escape_string()[/php] command on the $data variable before inserting?

Ronald
[php]
mysql_escape_string()
[/php]
Is deprecated. Instead use
[php]
mysql_real_escape_sting()
[/php]
Mar 10 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Mosher | last post: by
3 posts views Thread by Ruby Tuesday | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.