i'd like to know if it's allowed, i mean it worked for me, but is it a good practice? if not, what issues i will be dealing with ahead... i'm a php/script virgin btw.
// button
<button type="button" class="btn btn-primary" id="Submit-button" >Save changes</button>
<script>
$("#Submit-button").click(function() {
<?php
$db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$result = $db_connection->query('update reservation set gm_submit="Y"');
?>
});
</script>
-------UPDATE---------------
k.. here's what i did... and it worked fine...
$("#SaveButton").click(function() {
$.ajax({
url: 'db.php',
type: 'POST',
data: {}
});
});
i'm fine by this?