ID:               36692
 User updated by:  nobody at example dot com
 Reported By:      nobody at example dot com
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: irrelevant
 PHP Version:      Irrelevant
 New Comment:

is_int(), not int().


Previous Comments:
------------------------------------------------------------------------

[2006-03-11 01:26:04] nobody at example dot com

Description:
------------
On the documentation for mysql_real_escape_string at
http://us2.php.net/manual/en/function.mysql-real-escape-string.php :

// Quote if not integer
if (!is_numeric($value)) {
  $value = "'" . mysql_real_escape_string($value) . "'";
}


This is blatantly incorrect.  is_numeric() does *not* test whether
something is an integer.  This should probably be int() or
ctype_digit() instead.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36692&edit=1

Reply via email to