i'm wondering...
1. I don't understand this part of the sql statement:
OptionsDB..MyOpt (the .. and MyOpt).
You mean
DBName.Table?
Update ok, then
tlm is right: your query has a period to much.
2. Well, start using strict and warnings. You see a lot undeclared variables (but some you have declared?)
What is the use of
$Change = $row->[6]; when in the next line you print
print $row->[6] in stead of
print $change?
Later in the execute statement you use $change again...
I think it will be shorter just by cleaning up.
And have a look at your regexp... when using
.* it's better to not be greedy.
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.