Another PHP/HTML question

I think this is more of an HTML question, but I am also using PHP, so I decided to put it in the blog title.

If I wanted to create a form connected to a database and wanted to display the contents of a drop down field, I would use something like:
< option selected="selected" value="< ?php echo $script_architecture ?>" >< ?php echo $script_architecture ? >

How would I do the same with a checkbox?

The PHP problem I am having

I am trying to create a webpage that searches a MySQL database. I can write a simple page that can search on one of the fields. For example: SELECT * FROM table WHERE = $variable;

What I need to do is figure out how to do the same thing but with more than one field (and they might be empty). For example: If there are three fields for entering search terms: Name, Rank, SerialNumber, but the user only puts in less than all of them, I want the query to be something like SELECT * FROM table WHERE name` LIKE '%Named Person%' OR rank LIKE '%Rank Amateur%'

However, I don’t want it to try and add OR serialnumber LIKE'%%' because that would mess everything up.

If anybody could point me in the right direction, I would appreciate it.