> Hi all,
database. If I take the syntax in the perl script and paste it into a
mysql query, and substitute the variable for a value that exists in the
database, it will delete the entry. If I run it thru the web page, I
dont get an error, it says it worked ok and I get no errors. The remove
subroutine calls the removemac subroutine. Here is the code:
You didn't really state what the problem is, I assume the entry is not
actually deleted? Generally when we get no errors we are happy :-).
What is $delmac doing? Where does $self below come from? I suspect you
have broken encapsulation, which can be on purpose (I suppose).
You said in your description that 'remove' calls 'removemac'... why?
and more importantly *where*??
Many DBs require you to quote non-integer values, is $user an integer
value, you have asked for MAC addresses (are there colons in the
value?). The above is better written using DBI's binding capability.
Switch C<$user> to C<?> and add $user as an argument to C<execute> below.
$query <P> \n
Not necessarily, as you are finding. You should probably check that a
row has been deleted.