|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-29 23:18 UTC] judas dot iscariote at gmail dot com
[2007-04-30 13:22 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 07:00:01 2025 UTC |
Description: ------------ I have met this "bug" while I was creating a Russian site. I have a web form(ENCODING:UTF-8) and a simple query(My db uses UTF-8). When I submit the form, I get an error which says that the string is too long for the column but it is not the case(I just type the letters). After a while debugging I have found out what is the problem. When I use mysql_real_escape_string() I get the error else I do not. I have searched in the php site but I found nothing which has to do with encoding. Reproduce code: --------------- //I will give only the php code though it is very simple <?php //MySQL connections and other stuff like this has been omitted because //of the code's size $name = mysql_real_escape_string($_POST['name']); mysql_query("insert into users set name='".$name."'); ?> Expected result: ---------------- No errors. Actual result: -------------- MySQL error which says that the string is too long.