corrected rights problems
corrected execution of the mysql statement