Hi,
How do you process database update from a custom island?
Ref:- test code below.

Thanks Pak...

PHP Code
/* YOUR PHP CODE GOES IN THIS TOP SECTION */

	if (isset($_POST['action'])) {
		switch ($_POST['action']) {
			case 'insert':
				insert() ;
				break;
			case 'remove':
				remove() ;
				break;
		}
	}

	function insert() {
		 global $dbh, $userob, $id;
		 $uid = 696 ;
		 $query = "INSERT INTO ubbt_EXT_GAMES
						(FORUM_ID) VALUES (?) ";
// If I un-rem the next lines it fails with: - Status Code: 500 Internal Server Error
		 $dbh->do_placeholder_query($query, array($uid), __LINE__, __FILE__);
		 $userob->clear_cached_perms($uid);

		 print "The insert has been called.";
		 exit;
	}
	function remove() {
		 global $dbh, $userob, $id;
		 $uid = 696 ;
		 $query = "DELETE FROM ubbt_EXT_GAMES
						WHERE FORUM_ID =  $uid ";
// If I un-rem the next lines it fails with: - Status Code: 500 Internal Server Error
//		 $dbh->do_query($query, __LINE__, __FILE__);
//		 $userob->clear_cached_perms($uid);
		 print "The remove has been called.";
		 exit;
	}

/* YOUR HTML GOES BETWEEN THE EOF HEREDOC BELOW */
$body = <<<EOF

<!DOCTYPE html>
<html>

<head>
	<title>
		How to call PHP function
		on the click of a Button ?
	</title>
</head>

<body style="text-align:center;">
  <h1 style="color:green;"> Humbugs </h1>
  <h4> How to call PHP function on the click of a Button ? </h4>
  <br>
  <br>
  <form method="post">
	<input type="submit" class="button" name="insert" value="insert" />
	<input type="submit" class="button" name="remove" value="remove" />
  </form>
  <br>
  <br>
  <div id="foo"></div>
  <br>
</body>
</html>
<script>
$(document).ready(function(){
  $('.button').click(function(){
	var clickBtnValue = $(this).val();
	var ajaxurl = 'cache_builders/custom/portal_box_40.php';
	var data = {'action': clickBtnValue};
	$.post(ajaxurl, data, function (response) {
	  // Response div goes here.
	  $('#foo').html(response);
	});
	return false;
  });
});
</script>

EOF;