I have a list of LinkIDs and I want to do some updates on their records if they exist, or add them if not. So I am using a foreach loop:
foreach my $link (@list) {
...
my $rec = $DB->table('Links')->get("$link");
...
}
This works for the first value in the list and then gives me an error message:
Can't call method "prepare" without a package or object reference at /pathtoadmin/GT/SQL/Driver/MYSQL.pm line 36.
Any ideas what the problem may be? None of the IDs in the list exists in the table.
Thanks, Laura.
The UK High Street
foreach my $link (@list) {
...
my $rec = $DB->table('Links')->get("$link");
...
}
This works for the first value in the list and then gives me an error message:
Can't call method "prepare" without a package or object reference at /pathtoadmin/GT/SQL/Driver/MYSQL.pm line 36.
Any ideas what the problem may be? None of the IDs in the list exists in the table.
Thanks, Laura.
The UK High Street