Php code to update the profit column in database in every 1 hour
Never update it.  No UPDATE, noTRIGGER`.  Simply compute it based on the current time minus the time at which the user's entry was established.

There are standard formulas for "compound interest"; MySQL has all the math formulas needed to do the arithmetic.