This part of a wider script is ment to remove a selection of queries from the database,
The incoming variable is the id number seperated by a : is 98223:
the script just executes the first command and fails of the rest.
$delme = $in{'delme'};
@delme = split(/:/, $delme);
print $q->header;
foreach $dele(@delme)
{
$sqlQuery = qq~DELETE FROM enquiries WHERE id = "$dele" and company_id = "$SESSION{'company_id'}"~;
$result = &executeSQL($dbh, $sqlQuery);
print qq~$sqlQuery $result<br>~;
}
And the results which are provided by the print command, The first one runs ok and the others fail.
DELETE FROM enquiries WHERE id = "343" and company_id = "1" 1
DELETE FROM enquiries WHERE id = "344" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "345" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "347" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "348" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "349" and company_id = "1" 0E0
Any ideas anyone?
The incoming variable is the id number seperated by a : is 98223:
the script just executes the first command and fails of the rest.
$delme = $in{'delme'};
@delme = split(/:/, $delme);
print $q->header;
foreach $dele(@delme)
{
$sqlQuery = qq~DELETE FROM enquiries WHERE id = "$dele" and company_id = "$SESSION{'company_id'}"~;
$result = &executeSQL($dbh, $sqlQuery);
print qq~$sqlQuery $result<br>~;
}
And the results which are provided by the print command, The first one runs ok and the others fail.
DELETE FROM enquiries WHERE id = "343" and company_id = "1" 1
DELETE FROM enquiries WHERE id = "344" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "345" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "347" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "348" and company_id = "1" 0E0
DELETE FROM enquiries WHERE id = "349" and company_id = "1" 0E0
Any ideas anyone?