How is your PHP adding the value to the database? If it uses a GET parameter (which it shouldn't, seriously, don't), like the following...
$value = $_GET['x'];
...then you can totally cheat and do something like this with your JS:
(new Image()).src = 'path/to/addToDatabase.php?x=' + theValue;
But man, it's ugly and wrong and shouldn't really be done this way.