Michael Posted January 25, 2006 Share Posted January 25, 2006 HelloWhat I am trying to solve is as follows:I have a table that contains three fields that record preferences of user car models selected from a fixed list of car makes. Although the list is finite, any field can contain any member of the car make list.I want the ability to delete a car from the list. When I do that I want to go thru the table and replace the deleted car model with "empty"I know I can do with with three queries, but am trying to figure out if I can do it with one query. I've been researching on the 'net but am not coming up with an answer.What I would like to do is something likeUPDATE TABLE SET (field 1 = "empty" WHERE field 1 = 'toyata"), (field 2 = "empty" WHERE field 2 = 'toyata"), (field 3 = "empty" WHERE field 2 = 'toyata") WHERE userid = "id";I suppose my example is absurd but it gives the idea of what I want to do if possible.Or just use three queries.I would appreicate any comments.Thanks Link to comment https://forums.phpfreaks.com/topic/3255-query-construction/ Share on other sites More sharing options...
fenway Posted January 25, 2006 Share Posted January 25, 2006 See my response [a href=\"http://www.mysqlfreaks.com/forums/index.php?showtopic=8984&st=0&\" target=\"_blank\"]on this MySQLFreaks.com cross-post thread[/a]. Link to comment https://forums.phpfreaks.com/topic/3255-query-construction/#findComment-11109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.