I am using Hindi Font and storing into database. While inserting I use mysql_real_escape_string() function; its working fine on local but not on server.

showing on server Its adding extra slashes; but in local its showing correct
INSERT INTO tbl (num, address, name, father, state, city, gender, mobile, namdan_date, file, mobile1, english_name, dob) VALUES (5, '130] vkn\\'kZ dkWyksuh] nkmniqj', 'lqeu', 'Jh jktdqekj', 'Rajasthan', 'Alwar', 'Female', '', '2002-1-29', 'upload/', '371319&fu-', 'Suman', '1981--1');

Showing on local
INSERT INTO tbl (num, address, name, father, state, city, gender, mobile, namdan_date, file, mobile1, english_name, dob) VALUES (5, '130] vkn\'kZ dkWyksuh] nkmniqj', 'lqeu', 'Jh jktdqekj', 'Rajasthan', 'Alwar', 'Female', '', '2002-1-29', 'upload/', '371319&fu-', 'Suman', '1981--1');

Recommended Answers

All 6 Replies

Yes.. Both are of different versions

5.1.41 (Local)
5.0.95 (Server)

Then, what is the solution ?

Compare PHP.INI settings, perhaps something is different. Then you can set that locally and fix the issue.

Can u help ? How I can do this?

Find both PHP.INI's and compare them. Second option, run phpinfo() on both systems, and compare that too.

The versions are from phpinfo()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.