Change Status via MySQL/PHP

Discussion in 'PHP' started by Dutchcoffee, Oct 25, 2009.

  1. #1
    Hello all!

    I am in need of some PHP/MySQL help. I made a PHP script that gets some info form my database and echo's them on a (html) table. On my "Status" table row, I want to be able to change it from either Available or Unavailable. How would I go by doing that?

    Please let me know if I didn't make myself clear enough.

    Thanks.
     
    Dutchcoffee, Oct 25, 2009 IP
  2. Gungz

    Gungz Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please post the script, maybe I can help you by modifying the script.
    Thanks.
     
    Gungz, Oct 25, 2009 IP
  3. techbabu

    techbabu Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you know about mysql (select,insert,update,delete)?

    Techbabu
    ---------------
    Don't just make a website: make an impact
     
    techbabu, Oct 25, 2009 IP
  4. Dennis M.

    Dennis M. Active Member

    Messages:
    119
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #4
    If there is only one status option try something like:

    mysql_query("UPDATE prefix_table SET Status='Available'");
    PHP:
    And vice versa for the other. If you have multiple ones, add a WHERE ID='ID#' (if you're using ID's) use your unique primary key to set that so it doesn't conflict with other entries.

    Regards,
    Dennis M.
     
    Dennis M., Oct 26, 2009 IP