Selecting Only Numbers From Rows With MYSQL
When it comes to altering data from the database, PHP usually has an answer. In this particular situation, we are outputting weight from the database. The rows from the database output with lbs. For example, the weight for John Sims may be 175 lbs. Now, we want to remove the lbs because the plan is to use the 175 for comparison with Google Chart Tools.
How to we remove the lbs from each row that outputs? We use the preg_replace() function to select only digits.