how can I bound execution of sql query on button click action ?
-
Hi! I have a php page and I want to execute sql command after button click event. I put Confirm javascript function to get user choices on sql query and it returns true or false. but I could not bound this query execution on button click event whenever page is loaded sql command is executed without controlling the result of confirm function.
-
Hi! I have a php page and I want to execute sql command after button click event. I put Confirm javascript function to get user choices on sql query and it returns true or false. but I could not bound this query execution on button click event whenever page is loaded sql command is executed without controlling the result of confirm function.
I'm not certain what you are asking, but if I have it right this javascript runs in a php page? If so then you can test if the page has been submitted or loaded normally by testing the post or get value of the submit button. if(isset($_POST['Confirm'])) { ...run sql query } ....or... if(isset($_GET['Confirm'])) { ...run sql query }
-
Hi! I have a php page and I want to execute sql command after button click event. I put Confirm javascript function to get user choices on sql query and it returns true or false. but I could not bound this query execution on button click event whenever page is loaded sql command is executed without controlling the result of confirm function.
ok usually you have a form with a submit button, and the form's method is usually get or post. if its either you wanna say action="sqlpage.php" the sql page is the page where your sql query runs from. have a look at this page where i have a form and the user presses the submit to a php page where the data is then passed to email. Feel free to view the page source if it helps[] Hope that helps