UNkonwn Php code

Discussion in 'PHP' started by masterofzoo, Sep 26, 2011.

  1. #1
    Hi all,

    Is there any php code which allow me to delete "value of field of database" with reservation of the rest values and make that deleted field just empty but still there
     
    masterofzoo, Sep 26, 2011 IP
  2. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #2
    You just need to update the field so that its new value is "".

    
    myql_query('UPDATE table
    SET column=""
    WHERE column=whatever
    ') or die(mysql_error());
    
    PHP:
     
    blueparukia, Sep 26, 2011 IP
  3. masterofzoo

    masterofzoo Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you I was expecting that
     
    masterofzoo, Sep 27, 2011 IP
  4. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #4
    you might be expecting a php function that does it, since you want to modify the database a query should be executed in doing so..
     
    JohnnySchultz, Sep 28, 2011 IP
  5. technoamarie1

    technoamarie1 Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Try to refer here w3schools.com/sql/sql_delete.asp
    I can help you solve your problem
     
    technoamarie1, Sep 28, 2011 IP