mysql_real_escape_string and postal address data

wesleybanana

New Member
I'm using mysql_real_escape_string to cleanse data that's used in insert and update queries (postal addresses). But thing is, when I have something like this "25\5" the output ends up as 25. Mysql removes whats after the 25. I know it can be entered as 25/5, but some users may deliberately enter it as 25\5. How can I keep and retrieve it as 25\5 itself. Thanks.Edit:\[code\]$address = "23\5, Elm Street";$clean = mysql_real_escape_string($address);$data = http://stackoverflow.com/questions/3685228/mysql_query("insert into students (address) values ('$clean') ");if (!$data) { echo "Not ok" .mysql_error();}else { echo "Ok";} $data = http://stackoverflow.com/questions/3685228/mysql_query("select address from students");while ($info=mysql_fetch_assoc($data)){ print $info["address"]; print '<br>';}\[/code\]
 
Back
Top