Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    update row data?

    well I have this table `massages` and have these rows:
    id
    title
    message
    date1
    date2
    so if I want just to update the date2 with php what I should then insert inside SQL query?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Quote Originally Posted by hosam View Post
    well I have this table `massages` and have these rows:
    id
    title
    message
    date1
    date2
    so if I want just to update the date2 with php what I should then insert inside SQL query?
    No. you have a table with those columns (also known as fields). You might have *MANY* rows (also known as records), each with a different id, title, message, etc.

    To change just one field in one record, you would do something like
    Code:
    UPDATE message SET date2 = '2012-2-18' WHERE id = 17
    You would, of course, use the date you really want and the id you really want.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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