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