Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
<?php
include 'connections.php';//db 
?>
<button type="button" class="btn btn-primary btn-sm" onclick="myFunction()" id="reqst">Submit</button>

<script>
function myFunction(){
// include connections.php file
// need to perform sql operations like select,insert etc.

}
</script>
<?php
}

?>


after submit need to perform sql operations in javascript. Is there anyway to do this? please anyone help me
Posted

 
Share this answer
 
You client-side script has no access to the database directly. The closest is via Ajax call, but it still has to go through a server-aide script like php which in turns handles the database operation.
Ajax example[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900