Thanks, I finally got it working in this way:
$num_prob = mysql_num_rows($no_result);
$row = mysql_fetch_object($no_result);
$index=$num_prob;
//seeks to requested row in db. All counts start form 0, not 1, so need to minus 1 for accurate count
if (!mysql_data_seek ($no_result, ($index - 1) ))
{
echo "Cannot seek to row $i\n";
continue;
}
$lastprobno = $row->probno;
//substr -- Return part of a string
//-5 counts five chars back from the end and gives us the number part of the variable
$number = substr ("$lastprobno", -5);
$number++;
$prob = "$chassis-PROB-$number";
But if theres a way of retrieving the last record in the query, this could make my code much shorter and easier to read. How would I do that. I looked but couldn't find it.