|
Posted by Ian Hobson on 11/01/07 18:14
Hi,
I have a php app that works great on the development machine(s), but
fails on the production server!
Two problems.
A comment field is entered including the £ symbol - the single character
for sterling. The database should store that as £. The display as normal
and a field content should also display it as £.
Problem 1.
In the productions server the data is stored as A^ (A with a circuflex
followed by the £ symbol. On display and as field content it is A^£. If
the data is simply sent back, it becomes the 4 characters A^ Square A^ £.
Problem 2.
I have many numeric fields that distinguish between '' and '0' - the
first meaning not entered, and the second as entered, value zero.
The zeros are vanishing on the production machine if run fro the
client's browser, yet from a browser on the server, they work properly!
The code does the following...
processing parameters on sql statements - first utf8_decode, then
mysql_real_escape_string - the code fragment is...
$args[] = "";
foreach ($fragments as $i => $frag) {
$sql .=
$frag.mysql_real_escape_string(utf8_decode($args[$i]),$this->link);
}
Reading the data from MySQL - no processing.
Reading the data from post - trim only.
Preparing data for return to browsers . htmlentities($value)
So I expected £ from user to be stored as £(in UTF8) on database, read
back as £ and sent to browser as the entity £ - and this is
exactly what happens on my machine. But not on the production machine!
The database default collating sequences etc are the same in all cases.
Any ideas anyone as to why, and how to fix?
Thanks
Ian
Navigation:
[Reply to this message]
|