authenticgeek Posted June 6, 2003 Share Posted June 6, 2003 I have a few rows with some data in them and I want to replace single values within these rows. I\'m stuck on how to do it though. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/553-problems-with-mysql-syntax-for-replacing-values/ Share on other sites More sharing options...
shivabharat Posted June 6, 2003 Share Posted June 6, 2003 Are u looking for something like this SELECT REPLACE(\'phpfreak\', \'php\', \'mysql\') where cust_id=2; Link to comment https://forums.phpfreaks.com/topic/553-problems-with-mysql-syntax-for-replacing-values/#findComment-1859 Share on other sites More sharing options...
authenticgeek Posted June 6, 2003 Author Share Posted June 6, 2003 Ok. Here\'s what I tried again that doesn\'t work: SELECT FROM student REPLACE(namel) WHERE idnum=4123 VALUES (Do); Link to comment https://forums.phpfreaks.com/topic/553-problems-with-mysql-syntax-for-replacing-values/#findComment-1860 Share on other sites More sharing options...
shivabharat Posted June 6, 2003 Share Posted June 6, 2003 :arrow: REPLACE takes 3 values as arguments Link to comment https://forums.phpfreaks.com/topic/553-problems-with-mysql-syntax-for-replacing-values/#findComment-1861 Share on other sites More sharing options...
authenticgeek Posted June 6, 2003 Author Share Posted June 6, 2003 Actually, the UPDATE command was what I was looking for. UPDATE table_name SET column_name=updated_value WHERE value=yourvalue; Thanks anyways Link to comment https://forums.phpfreaks.com/topic/553-problems-with-mysql-syntax-for-replacing-values/#findComment-1862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.