Results 1 to 8 of 8

Thread: Updating SQL

  1. #1
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default Updating SQL

    OK I have this

    PHP Code:
    $update mysql_query("Update rares set title = '$value' where name = '$name'"); 
    And I have all the sql tables setup but it doesnt update
    Anyone know why?

    Cheers

  2. #2
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    PHP Code:
    mysql_query("UPDATE rares SET title = $value WHERE name = $name"
    Remember before that you have to select your database ect.


  3. #3
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    PHP Code:
    mysql_query("SELECT * from rares where name = '$_GET[rares]'");
    mysql_query("UPDATE rares SET title = $value WHERE name = $name"); 
    Still doesnt update it

  4. #4
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    PHP Code:
    mysql_query("SELECT * from rares where name = '$_GET[rares]'"); 
    mysql_query("UPDATE rares SET title = $value WHERE name = $name"); 
    Still doesnt update it

  5. #5
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    mysql_query("SELECT * from rares where name = '$_GET[rares]'");
    mysql_query("UPDATE rares SET title = '$value' WHERE name = '$name'");
    And check that title and name exists

    Edit: And you dont need to select your database, and make sure $value and $name are declared.
    Last edited by Blob; 17-02-2007 at 11:57 AM.

  6. #6
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default


    Still dont work
    PHP Code:
    $value htmlspecialchars($_POST[title]); 
    $name htmlspecialchars($_POST[name]);
     
    echo (
    "Rare Updated");
    mysql_query("SELECT * from rares where name = '$_GET[rares]'");
    mysql_query("UPDATE rares SET title = '$value' WHERE name = '$name'"); 


    CLOSE PLS, FIXED THANKS DUNKO. I HAD MY NAME TEXTBOX CALLED NAEM NOT NAME LOL
    Last edited by Robbie; 17-02-2007 at 12:16 PM.

  7. #7
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    They no longer close threads at the request of users.

  8. #8
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    Oh well. Cheers Drompo n Dunko

Posting Permissions

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