PHP Code:
if ($dbCustName['ro_status'] == FINISHED) { 
Is FINISHED a constant, i.e. defined somewhere else as:
PHP Code:
define("FINISHED","some_value"); 
or is it supposed to be:
PHP Code:
if ($dbCustName['ro_status'] == "FINISHED") { 
I think I remember from earlier scripts that it was "FINISHED" but I'm not sure anymore...

Comment: It won't break your application, but if you're only looking for only one record in the table, try to LIMIT it:
PHP Code:
$query3 "SELECT * FROM adv_info WHERE adv_num = '$advnum' LIMIT 1"
Works the same but a dot would look nicer... Also near the end of the line..
PHP Code:
echo "RO Number: "$dbCustName["ro_num"]...