SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    685
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make image button run a mysql query?

    I need to set up something like the following. When you go to a page it will say something like Would you like to continue with this function yes or no?

    If you click yes, run mysql query 1.

    if you click no, run mysql query 2.

    Something like this.

    Anyone know how to do this?

  2. #2
    SitePoint Member
    Join Date
    May 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you could make the image a link to someting like page.php?continue=yes

    Then in the page do something like

    PHP Code:
    if ( $_GET['contine'] == 'yes' ) {
       
    # run query 1 
       
    mysql_query ( ..... );
    } elseif ( 
    $_GET['continue'] == 'no'] {
       
    # run query 2
       
    mysql_query ( .... );

    Otherwise, if you dont want to reload the page you could make an AJAX request to a PHP page that runs a certain query.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •