Electric Vehicle Forums

Electric Vehicle Forums (/forums/)
-   Our Announcements (https://electricvehicleforums.com/forums/our-announcements-8/)
-   -   Mileage Database Notice (https://electricvehicleforums.com/forums/our-announcements-8/mileage-database-notice-1083/)

Jason 11-15-2004 08:21 PM

Suddenly it struck me that there are actually more than 2,478,935 miles worth of data in the Real Hybrid Mileage Database (as of 11/15/04 @ 11PM EST). Currently, this number is obtained by adding the total distance variable for each car and totaling. However, when I added this statistic, I apparently forgot there are also tanks in the database that aren't contributing to a vehicle's total because of both an odometer override and additional tanks. For this reason, there very well may be a few hundred thousand more miles in the database than I thought. I'll try and update the code to reflect this ASAP.

Jason 11-15-2004 08:37 PM

Odd. I made a change that should have fixed the code, but it actually came up with LESS miles! Hmmm. Who knows PHP?

OLD
Code:

$getmiles = mysql_query("SELECT SUM(sumdistance) AS total FROM car");
$miles = mysql_fetch_array($getmiles);

NEW
Code:

$getmiles = mysql_query("SELECT SUM(sumdistance) AS total FROM car WHERE lmpgoverride != 0");
$carmiles = mysql_fetch_array($getmiles);
$getmoremiles = mysql_query("SELECT SUM(distance) AS total FROM data");
$datamiles = mysql_fetch_array($getmoremiles);
$miles = $carmiles['total'] + $datamiles['total'];


Jason 11-16-2004 01:01 PM

Fixed! Now at 2,718,747 miles


All times are GMT -7. The time now is 05:47 PM.


© 2024 MH Sub I, LLC dba Internet Brands