Well, first off:
What errors?
Second off:
What have you tried to do to alleviate this problem?
Third:
Please don't just say "What am I doing wrong?". Makes people want to help you less.
First thing I see is a huge security issue. Try to never use $_POST[] directly in an SQL statement. Rather, assign them to variables, then check that they're what they should be, then run the query.
Next: I think you might be misinterpreting the ternary operator. Perhaps "NULL" is not what you want. I think this might better suit you:
(empty($_POST['itemName'])) ? '' : "itemName LIKE '%".$itemName."%'";