From a usability standpoint, I'm not sure it is wise to put an "add" button next to a "search" button where a user can input values to either be added or searched upon. Might be better to make that two separate forms so users are not confused or accidentlly clicking the wrong button.
Assuming you break up the form in two separate forms, follow gufmn's advice of having the the form handling script take the action based ont the $_POST value it receives. Using onClick is a client-side action. It has nothing to do with form handling by PHP.
kellog also gave a smart workaround to the original post.
The overall design of the form should be looked at again, though. Like I said, don't confuse your visitors or leave room for accidental button clicks by having the "add" button right next to the "search" button in one form. I know you see people do it today by having an "add" and "cancel/reset" button next to each other, but in those cases, the reset or cancel button do not call the form handling script to do any processing, or at least it shouldn't.