Does anybody know what this could be? I have a coupon i want to store in another table that consists of varchar(100) fields. When I print_r the value on the screen all is fine, but it is inserted into the table as a way different much smaller number than the original .... (No truncation!)
SQL: my coupon does not store well.
|
|
These kind of thing are hard to debug, normally this happens when the data type is changes somewhere. Here's how I debug this kind of stuff, write a tiny echo function that writes something on both sides of your variables like this
function e($x){
echo '[' . $x . ']';
}
then in your code put this line several places
e($order->coupon_code); // or whatever variable you use
find out where the value is getting truncated, and you'll have your culprit.
|
|





Joined: 09/06/2007