note 39370 added to function.setlocale

From: Date: Mon, 26 Jan 2004 09:59:07 +0000
Subject: note 39370 added to function.setlocale
Groups: php.notes 
Request: Send a blank email to php-notes+get-64196@lists.php.net to get a copy of this message
<p>Be carefull - setting a locale which uses commas instead of dots in numbers may cause a mysql db not to understand the query:</p> <?php setlocale(LC_ALL,"pl"); $price = 1234 / 100; // now the price looks like 12,34 $query = mysql_query("SELECT Id FROM table WHERE price='".$price."'"); ?> <p>Even if there is a price 12.34 - nothing will be found</p> ---- Manual Page -- http://www.php.net/manual/en/function.setlocale.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39370 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39370&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39370&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64196) next »