You simply wan't to check if it's been used? I would do a query like this:
SELECT ` FROM `form1` WHERE `code` = '$pass' LIMIT 1
Then, you'd simply check the value of [man]mysql_num_rows/man to see if it's 0 or 1. Some tweaks in my query:
Just SELECT'ed 1 instead of making SQL count something.
Used simple comparison ('=') instead of a LIKE comparison.
Added a 'LIMIT 1' so MySQL knows I only need 1 row to satisfy the query.
Also, a note about your code:
Array indeces in your case should be strings. $row[name] does not have a string as an index, but a constant. PHP will detect this (assuming there actually isn't a constant named 'name') and throw an E_NOTICE and then assume it is a string. So, use quotes: $row['name'].