Added tablename variable to php method.