J
|
Jane 5/21/2009 |
Hi, select * from Travel_Objective where `list`like '%1%' or `list` like '%3%' |
N
|
nwanzeo 8/14/2009 |
Hi, I suppose SQL should look like:
|
N
|
nwanzeo 8/16/2009 |
Hi Jane, I have the same problem as above except that i am not able to populate the category field with multiple values from the checkbox. Thus, if a user select multiple options from the check boxes my database only displays one. Please how can i insert multiple values from the check boxes into a field (maybe separated by comma)? Thanks in advance.
|
A
|
acpan author 8/16/2009 |
Hi,
|
N
|
nwanzeo 8/16/2009 |
Hi, Go to visual editor, Set the new field to store the checkbox selection to:
|
J
|
Jane 8/17/2009 |
Hi, |
A
|
acpan author 8/17/2009 |
Hi acpan, Thanks very much. You solve my problem! If you don't mind, i need further advice. My problem really is that i have two tables (members and subgroups). Members can belong to multiple subgroups (which you earlier post resolved) and a subgroup could have multiple members. I implemented a master detail relationship for the two table. Now, members are able to select multiple subgroups (as checkbox option). The issue now is that from the subgroup table, there is no way of knowing who belong to which group as the primary key field in the members table has a list of comma separated values (except where a members belongs to only one subgroup). Thanks in advance.
|
N
|
nwanzeo 8/17/2009 |
Hi, In CSV, it's hard to identify the master unless you form all possible SQL conditions for the Query in events codes. I managed to form a all conditions SQL as follows: " subgroup_id like 'x,%' or subgroup_id like '%x,%' OR subgroup_id like ',x' OR subgroup_id like 'x' OR subgroup_id like '%,x' " So if data is: Row 1: "2,3,1" Row 2: "1,2,3" Row 3: "3,1,2" Row 4: "2" Row 5: "1,3,2" And if you are interested in ID=2 in the CSV for all rows, you can apply the SQL conditions will get all rows who has "2": " subgroup_id like '2,%' or subgroup_id like '%2,%' OR subgroup_id like ',2' OR subgroup_id like '2' OR subgroup_id like '%,2' " That will give you all master rows who have "2" in their CSV values. In events codes, you can do some pre-processing and get to the above stage. I am guessing what you need, if the above does not help, please try Jane's advise. acpan.
|