First of all:
...........LIMIT 1
You're only going to go through the loop once, so there's no point making a loop out of it (loops are for doing something maybe more than once).
Second, the calculation could have been done in the query, but maybe you're doing other things with the same fields further down.
Third, the calculation can be simplified because all the percentages are precalculated, then you undo the percentage scaling, then you rescale it back to being a percentage:
$row = mysql_fetch_assoc($result);
$maximumPoints = 5;
$point = 0;
if($row['title'] != '')
$point++;
if($row['name'] != '')
$point++;
if($row['surname'] != '')
$point++;
if($row['identityno'] != '')
$point++;
if($row['gender'] != '')
$point++;
$percentage = ($point/$maximumPoints)*100;
echo $percentage."%";
(at which point you could use PHP's type juggling and write [font=monospace]$point += ($row['gender'] != '');[/font] instead of the if statement).
But more to the point:
AshleighCo wrote:The percentage shows in the echo but the total is wrong at 0% - it's not taking the values of 20 points for each field that is completed and including them in the "addition" part of the percentage calculation.
So you're showing us the bit that works but you haven't shown us the bit that isn't working? What's this "'addition' part of the percentage calculation"?