Is whatever $catagory a string datatype? If so, $criteria also has to be a string, so you need to block it into single quotations.
The notice is caused by being unable to construct the query since its blocked into an isset check on $_POST['search']. If you don't post the form, it will still attempt to execute the while, so when you first load the form it doesn't have a query to execute and triggers a notice that the variable $resource doesn't exist (and therefore cannot be fetched). Move the block with the fetch into the same block that queries.
I'd also pull this off:
|| isset($_POST['submit']). You shouldn't bother searching for a submit button; IE (at least olderish versions) refuse to accept that a form with just that button is valid if you hit the enter key instead of clicking. Therefore it will not consider it successful when passing to the server, so even if it is submitted it will not provide it to the server (in violation of W3 successful field standard). So you should simply check for the fields you are interested in.