Precisely what happens? Does it return nothing, or get the wrong data? How far through the code does it get before it stops running the way you wanted it to? Have you checked that the field name on your form is correct? Can you show the code that you call this page from, in case there’s a typo?
Also have a look at PDO or mysqli to access your database - the old-style MySQL calls are deprecated now.