The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
user profile fields - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27) +--- Thread: user profile fields (/showthread.php?tid=1419) |
user profile fields - tmith - 04-05-2019 Hi I'm considering using UserSpice as the user logic in a project. My UseCase is targeted towards college students. The project is to be a directory/profile kind of app where users signup/join, and modify the profile data. The user profile will have multiple fields. Since the target users are college students, the fields will look like the following: -fname -lname -zipcode -State -College -Major/Dept -Year (1st/2nd/3rd) -ReferrerID -JoinStatus -dateJoin -userID -Etc... Setting up the tables/schema would be trivial. My issues/question, is how I might set up the logic to allow a user to be able to query the underlying db/tbls to then generate/display a list of users based on the different fields. Should the app/logic have hardcoded query/sql where the input columns are defined? The app would/might have a select page where each of the above fields maps to a select/input field in a "form". The user would be prompted to select any/all of the fields. A "default" value would be assigned to any field not selected by the user. The app would then use ajax/async calls to then process the backend logic.. This approach would/should work with a single well defined/well checked/qualified query statement. The resulting rows would then drive a paged set of rows for the user to view in the clientside app. Does this make sense? Have I missed anything? If anyone has any thoughts on this, feel free to post. Thanks RE: user profile fields - mudmin - 04-05-2019 Writing a search engine is a little different than a typical db query. I wrote one for you using regular php (not ajax) that searches the users table and does the proper binding etc to prevent sql injection attacks and stuff like that. If you install userspice and replace the stock index.php file with this https://pastebin.com/RQx2stSf You will see that I wrote a quick search engine that lets you search the first and last name columns of the users table and gives you the results. I hope it helps. |