The real_escape_string of mysqli changes the date format of my string field from "YYYY-MM-DD" into "DD.MM.YYYY". My date is in MySQL format "YYYY-MM-DD", when I want to sanitize it with real_escape_string, it (string) is returned in changed format.
$this->birthday=$this->db->real_escape_string($this->birthday);
How to prevent this format change!?
Note: I use real_escape_string() dynamically to sanitize all elemetns from web from like:
foreach($array as $key=>$val) //textboxes
{
if(in_array($key,$this->fields))
{
$this->$key=$this->db->real_escape_string($val);
}
}
So I cannot explicitly return (reset) dateformat for particular field.
And it seems that it hapends only on Windows platform (not Linux). So it could have something to do with localization settings on my platform.
Aucun commentaire:
Enregistrer un commentaire