You have 1 bug:
$result = "SELECT * FROM ResultsDB...
You need to send this queyr to the db-- code needs to be:
$result =mysql_query("SELECT * FROM ...etc, etc., etc");
Now the result will contain a mysql resource. Now
$row=mysql_fetch_array($result)
Will work.
Your code looks like it otherwise might work, but I think it might prove a little buggy. It will certainly improve while you work on it.
I have never seen anybody try to fetch rows from the same result using two different methods:
$topRow = mysql_fetch_row($result);
$row = mysql_fetch_array($result)
I don't know how this will work:
my guess is that this will return unwanted results: i.e, results of first returned row will be found in $toprow, results of rows 2...n will be found in $row. IF there is only one row, returned (likely) then you will never find values in $row...at least that's my guess.
Also, why are you using two variables for a db search? Typically you would search based on one unique identifier:
db generated id
OR
phone number
OR
social security number
OR
email address
etc.
As you no doubt know, users who enter a valid number with a misspelled name will in your code return no values
.