Gossamer Forum
Quote Reply
Weird GT::SQL bug
Hi,

Got a bit of a weird bug with GT::SQL.

Here is some example code:

Code:
$DB->table('DomainAccounts')->add( {
Username => $in->{Their_Username},
URL => $in->{URL},
AccountExpDate => $exp_date,
IsLiveAccount => 1,
PaymentPeriod => $in->{PaymentPeriod},
AutoRecurringEnabled => $in->{AutoRecurringEnabled},
Reseller => $IN->param('Reseller');,
DateCreated => GT::Date::date_get(),
CompanyName => $in->{CompanyName}
}
) || die $GT::SQL::error;

Changing to this code works fine:

Code:
my $reseller = $IN->param('Reseller');
$DB->table('DomainAccounts')->add( {
Username => $in->{Their_Username},
URL => $in->{URL},
AccountExpDate => $exp_date,
IsLiveAccount => 1,
PaymentPeriod => $in->{PaymentPeriod},
AutoRecurringEnabled => $in->{AutoRecurringEnabled},
Reseller => $reseller,
DateCreated => GT::Date::date_get(),
CompanyName => $in->{CompanyName}
}
) || die $GT::SQL::error;


Basically, what seems to happen - is after the "Reseller" bit, it was "pushing" all the fields along.

So, instead of being:

Code:
Reseller => xxxx,
DateCreated => 2009-10-12,
CompanyName => something

...it seems to be getting passed in as:

Code:
Reseller => DateCreated
2009-10-12 => CompanyName
something => undef

Now, the only way I can seem to get around this - is by putting the "reseller" into a $reseller variable, and using that instead (rather than $IN)

Is this a bug, and if so - and chance of fixing it? =)

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Weird GT::SQL bug Andy 1829 Dec 2, 2009, 12:07 AM
Thread Re: [Andy] Weird GT::SQL bug
brewt 1720 Dec 2, 2009, 12:31 AM
Post Re: [brewt] Weird GT::SQL bug
Andy 1715 Dec 2, 2009, 12:35 AM