[wp-hackers] $wpdb->prepare and %d for integers

24/7 24-7 at gmx.net
Mon Aug 15 01:36:06 UTC 2011


As to the description of the *%d type specifier* for *sprintf* in the php 
manual <http://php.net/manual/en/function.sprintf.php>, *%d* should be "*d - 
the argument is treated as an integer, and presented as a (signed) decimal 
number.*". I run into the problem that using *$wpdb->update* along with the 
*$format* and *%d* removed all values behind the comma (or "ceiled" them?). 
It took me ages to find that problem and so I had to insert strings into *double 
*columns as a work around.

I wanted to open a ticket about that, but I couldn't really get behind the 
reason why this happens (and ran out of time). Is there anyone who knows 
what exactly is responsible for this behavior - as this is (imo) a bug?

Best wishes,
K.


More information about the wp-hackers mailing list