It's possible. You can make PHP print the varibles to a hidden form, which then can be accessed by the JavaScript:
<?php
print "<form name=\"dbForm\">";
print "<input type=\"hidden\" name=\"dbValues\" value=\"$phpDbVariable\">";
print "</form>";
?>
Then you call your JavaScript function:
yourFunction(dbForm.dbValues.value);