Freedom-n-Democrazy Posted September 12, 2011 Share Posted September 12, 2011 I have this: +------+---------------+------------+ | id | primarycolour | pricerange | +------+---------------+------------+ | 1 | black | 1 | | 2 | brown | 2 | +------+---------------+------------+ ... and I want to change the pricerange of "id 2" from 2 to 1. I tried this, but it didn't work: UPDATE products(pricerange) where id=2 VALUES(1); Does anyone know how it can be done? Link to comment https://forums.phpfreaks.com/topic/246947-updating-field-data/ Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2011 Share Posted September 12, 2011 Where did you get that code? UPDATE products SET pricerange= 1 WHERE WHERE id = 1 Link to comment https://forums.phpfreaks.com/topic/246947-updating-field-data/#findComment-1268247 Share on other sites More sharing options...
Freedom-n-Democrazy Posted September 12, 2011 Author Share Posted September 12, 2011 I made an educated guess. Thanks for that code man, it worked. Link to comment https://forums.phpfreaks.com/topic/246947-updating-field-data/#findComment-1268248 Share on other sites More sharing options...
Muddy_Funster Posted September 12, 2011 Share Posted September 12, 2011 no problem, was just concerned in case someone had posed that syntax in a guide some place. Link to comment https://forums.phpfreaks.com/topic/246947-updating-field-data/#findComment-1268275 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.