are you talking about a mysql database? if this is the case, you can use the plugin : "ajax".
See the screenshot.
With ajax you request your php page on your website.
In this php page you do the request on database (mysql for example) and the php page return the result.
When ajax complete the request you can do what you want with the result where you want.
You can do the same for post information in database , you just use POST instead of GET.