Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. how can I bound execution of sql query on button click action ?

how can I bound execution of sql query on button click action ?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
databasequestionjavascriptphp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hande54
    wrote on last edited by
    #1

    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.

    C A 2 Replies Last reply
    0
    • H hande54

      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.

      C Offline
      C Offline
      cjoki
      wrote on last edited by
      #2

      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 }

      1 Reply Last reply
      0
      • H hande54

        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.

        A Offline
        A Offline
        abushahin
        wrote on last edited by
        #3

        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

        abushahin

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups