You're doing a few things wrong here. The main thing is that you're trying to use PHP as if it were JavaScript. [Edit: As devinemke said.] With js you can use the "onclick" event (but not to query the database on the server); with PHP you need to submit the form to a script that will then do the post variable checking/manipulation and querying. That is, "Javascript is client-side, PHP is server-side."
Also, you can't call a class function directly like that. You have to use a class object or the "::" syntax.
Inside the class "$this-" should be "$this->".
For the html form: you need to either "echo" it from PHP, or exit PHP first.