What's the best way to pull up a random question from a MySQL database on the click of a button in HTML?

Do I use a normal onclick event, calling a JavaScript function, whose code is first echo'ed by a PHP script? This is the best thing I can come up with, but it's ugly and hard to deal with, and I haven't gotten it to work yet. Any better ideas?
Update: And by "question," I just mean a row from a table (my table is a list of questions and answers)