Need SQL Query Written

Discussion in 'Programming' started by Biron, Apr 1, 2008.

  1. #1
    I need a SQL query to update the following and not sure how to code it to run from a php file on server and called in a script:

    Database: bironinc_sharkysforums
    user: bironinc_Biron
    pw: Grandmaster5


    Need:

    table: phpbb_users
    row: user_type <---- Need to change to "0"


    Have the query where user_id = $user_number LIMIT 1


    Please reply with price
     
    Biron, Apr 1, 2008 IP
  2. ekarey

    ekarey Active Member

    Messages:
    277
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    UPDATE phpbb_users SET user_type=0 WHERE user_id=$confirmedid LIMIT 1
     
    ekarey, Apr 1, 2008 IP
  3. Biron

    Biron Banned

    Messages:
    341
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    But how would I write the entire MYSQL query to access that database with that user name and query that.

    I need it to run through a php file when called from a server, not through phpmyadmin, sorry if I phrased that wrong :S
     
    Biron, Apr 1, 2008 IP
  4. ekarey

    ekarey Active Member

    Messages:
    277
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    I'll PM you the entire code
     
    ekarey, Apr 1, 2008 IP
  5. Biron

    Biron Banned

    Messages:
    341
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    I got someone workin on this, thank you :D
     
    Biron, Apr 1, 2008 IP
  6. ekarey

    ekarey Active Member

    Messages:
    277
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    
    <?php
    
    $link = mysql_connect('localhost', 'bironinc_Biron', 'Grandmaster5');
    mysql_select_db('bironinc_sharkysforums');
    
    $result = mysql_query("UPDATE phpbb_users SET user_type=0 WHERE user_id='".$_GET['confirmedid']."' LIMIT 1");
    
    echo "Done!";
    
    ?>
    
    PHP:
    Actually here is the code. Copy the code and save it as confirmuser.php What you want to do is open it in a browser like this:

    http://www.mywebsite.com/confirmuser.php?confirmedid=172

    You can change the confirmedid # at the end of the URL to any user id you want and it will update.

    Thanks
     
    ekarey, Apr 1, 2008 IP
    Biron likes this.