title: Is there an equivalent for this trigger in stored procedures
body: <p>I've been using this MySQL trigger on a dedicated server, so every time a table is updated, it calculates a new sum and updates another table:</p>
  
  <pre><code>delimiter |
  CREATE TRIGGER after_insert_rep_points AFTER INSERT ON users_reputation
  FOR EACH ROW
  BEGIN
  DECLARE new_total INT(10);
  SELECT SUM(rep_points) INTO new_total FROM users_reputation
  WHERE user_id = NEW.user_id;
  UPDATE users SET rep_total = new_total WHERE user_id = NEW.user_id;
  END
  |
  delimiter ;
  </code></pre>
  
  <p>I now need to use this on a shared hosting environment, but unfortunately, due to security precautions, I cannot have SUPER USER privileges in a shared environment, which is required for triggers. I don't understand this. I think everybody should be able to use triggers.</p>
  
  <p>I'm not that clued up on stored procedures, in-fact I'm useless, but I'm wondering if this query can be executed using one and if so, can anybody can give me any pointers?</p>