View Single Post
Old 02-19-2012, 06:31 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote