i have a javascript code for printing process.. what i want is, when i click on print button, it will proceed to print page, and at the same time, it will update my table in mysql. i'm doing like this.. but it only perform printing process.. not both.. any suggestion from you all?
help.. :(
here is the javascript code:
<script type="text/javascript">
function printpage()
{
document.getElementById('buttonpurchse').style.visibility='hidden';
window.location.reload();
window.print();
$result = mysql_query("UPDATE maklumatimport SET tarikhExpiredEksport = '$date2' WHERE noRujukan = '$noRujukan'");
$row = mysql_fetch_array($result);
}
</script>
and this is button from form.
<button id="buttonpurchse" type="button" title="Print Purchse Request" onClick="printpage()" style="visibility: visible"><img src="img/print.png" height="60" width="100" ></button>