![]() |
|
how to insert multiple keywords in a single column through registration form? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141) +---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50) +---- Thread: how to insert multiple keywords in a single column through registration form? (/showthread.php?tid=5571302) |
how to insert multiple keywords in a single column through registration form? - srcsameer - Mar 10, 2017 i am trying to create a registration form and i have a column where i want to insert multiple values in that single column(catagory) through check Box. is there a possible way to do that? have a look at my php files. Thank You, This is my Dboperation.php PHP Code And this is my main registration.php file PHP Code Any help will be appreciated. * - ShadowCloudGH - Mar 10, 2017 Why not have a one to many table saving the categories? While you could save this in one column, I would suggest creating a new table called Employee_Category and saving an EmployeeId against a CategoryId. You could then have multiple records for the same employee in this table? This will save you a lot of time manipulating strings later on... * - srcsameer - Mar 10, 2017 (Mar 10, 2017 12:47 AM)ShadowCloudGH Wrote: Why not have a one to many table saving the categories? While you could save this in one column, I would suggest creating a new table called Employee_Category and saving an EmployeeId against a CategoryId. You could then have multiple records for the same employee in this table? Bro... i Didn't get you... i can't change my table or columns i just want is: while registering one can check checkbox item/s and then selected keywords will be inserted to category column also i want to retrieve that user's id using that keyword. like if i will post checkbox1 then user's who has checkbox1 in their category column their names will be shown. did you get it? * - ShadowCloudGH - Mar 10, 2017 (Mar 10, 2017 06:03 AM)srcsameer Wrote: Yes, but you clearly didn't get me :) If you save this in one column, potentially delimited by something like a comma, or heaven forbid a pipe (|) or something even more sinisiter like a combination of chars (#split#) then you end up with the following in the record: UsrID1>> cat1#split#cat2#split#cat5 UsrID2>> cat1#split#cat3 UsrID3>> cat5 UsrID4>> cat3 UsrID5>> cat1#split#cat3 UsrID6>> cat4#split#cat7 The problem with this is, now if you want all users with cat5 selected in registration, you have no way of getting info without going through all the records in the table. This is concerned an anti-pattern * - srcsameer - Mar 10, 2017 (Mar 10, 2017 06:43 AM)ShadowCloudGH Wrote: Yes, but you clearly didn't get me :) Can you just show me by editing my php file Dboperation and registration... i am a learner bro. (Mar 10, 2017 06:43 AM)ShadowCloudGH Wrote: Yes, but you clearly didn't get me :) Hi! bro please reply... can you show me how to o it? it's really important for me. |