njdirt Posted August 13, 2009 Share Posted August 13, 2009 Hello, How can I empty all values in a db field (within a table of course) and then reload every entry with the same info? For instance, take a pref_contact field. There are many entries in this table, some have a value for "pref_contact" and others don't. Either way, I want to change the field value of all of them to "11000". Is this the correct SQL query: INSERT INTO TableX (pref_contact) VALUES (11000) And will it change the value in every entry in the table? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/170133-solved-update-field-data-for-all-db-entries/ Share on other sites More sharing options...
DEVILofDARKNESS Posted August 13, 2009 Share Posted August 13, 2009 Nah, If there already is a value you should do: UPDATE TableX SET pref_contact = 11000 Link to comment https://forums.phpfreaks.com/topic/170133-solved-update-field-data-for-all-db-entries/#findComment-897430 Share on other sites More sharing options...
njdirt Posted August 13, 2009 Author Share Posted August 13, 2009 perfect, thanks! Link to comment https://forums.phpfreaks.com/topic/170133-solved-update-field-data-for-all-db-entries/#findComment-897459 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.