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! Quote 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 Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.