Is UserID unique?
Cause....is the person doing this, have a Type 'Train'?
IMO, I feel you're getting the average of one row of data with that query.
Try it with this...
PHP Code:
$Vehicles2=mysql_fetch_assoc(mysql_query("SELECT avg( VehCondition ) as ConditionRating FROM vehicles where Type='Train'"));
I took out the userID requirement of the query, and made it a fetch_assoc.
Try this with fetch_array and fetch_assoc, see if those two seem to work.
</span></span>
|