tom123
08-08-2006, 04:46 PM
Hey guys,
Having real trouble with code below. It wont add the record to the database, any suggestions?
member, non-member are number types in db
date_start & date_end are Date types in db.
my ($db,$ref) = @_;
my %products = %{$ref};
# Create query to add new product
my $query = qq(INSERT INTO t_mou_eco_product
VALUES ($products{'code'},
$products{'name'},
$products{'description'},
NULL,
$products{'currency'},
'$products{'non_member_price'}',
'$products('member_price'}',
NULL,
$products{'date_start'},
$products{'date_end'},
1,
NULL,
NULL,
NULL,
NULL,
$products{'awards_type'}));
# Run query and create handle for it
$db->Execute($query);
#print($query);
$db->Commit();
Thanks in advance
Having real trouble with code below. It wont add the record to the database, any suggestions?
member, non-member are number types in db
date_start & date_end are Date types in db.
my ($db,$ref) = @_;
my %products = %{$ref};
# Create query to add new product
my $query = qq(INSERT INTO t_mou_eco_product
VALUES ($products{'code'},
$products{'name'},
$products{'description'},
NULL,
$products{'currency'},
'$products{'non_member_price'}',
'$products('member_price'}',
NULL,
$products{'date_start'},
$products{'date_end'},
1,
NULL,
NULL,
NULL,
NULL,
$products{'awards_type'}));
# Run query and create handle for it
$db->Execute($query);
#print($query);
$db->Commit();
Thanks in advance