SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Deleting an item from a list
-
Jan 3, 2005, 09:35 #1
- Join Date
- Mar 2003
- Location
- England, UK
- Posts
- 2,906
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Deleting an item from a list
I had a quick flick through MySQL's string functions here and the only thing I found close to what I want to do is the replace function.
I have a field in my table which is numbers seperated by commas. An example would be:
1,2,3,4,5,6
If I wanted to update that field with one value removed is there a MySQL function to remove an item from a list, kind of the opposite to how FIND_IN_SET locates an item in a list?
-
Jan 3, 2005, 11:40 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
not that i know of
i think you'd have to use REPLACE()
you'd have to be very careful, and make sure that when you remove 3, you don't accidentally remove 13 as well
-
Jan 3, 2005, 11:46 #3
- Join Date
- Mar 2003
- Location
- England, UK
- Posts
- 2,906
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ah i'll just do all the work using PHP then. Although a function which did this would be a welcome addition to MySQL
Bookmarks