SQL: my coupon does not store well.

Posts: 203
Joined: 09/06/2007

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!)

Posts: 95
Joined: 10/29/2007
Bug Finder

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.

Jim
www.ipodfitnesscenter.com

Posts: 203
Joined: 09/06/2007

i know it's the little things .. let go hunting then Eye-wink