PHP runs a script that correctly calculates a value. When I echo that value out it comes out as 4.865472349
Then a simple update script is used to enter the value into my database.
$query = "UPDATE members
SET rating = $r
WHERE username = '$username'";
mysql_query($query);
When I do this, the value that is entered into the database is 5.
If I replace $r in the previous formula with 4.865472349 directly, it produces the same result.
Clearly this is because my SQL type was set to "integer"
But Im not sure what to change it to in order to fix this issue. Any help?