moose-en-a-gant Posted February 4, 2015 Share Posted February 4, 2015 Part I control statement list generator I think this could be simplified with a permuation but first, this problem of creating a list based on certain conditions, This is the rough structure of my list generator: First I have a table with people in it; stores a person's id, gender, orientation, interested partner, age The orientation is uncertain because in some cases it seems redundant like a transgender person declaring a gender Anyway, so given the five pieces of information I create an "alogrithm?" or control statement list generator based on user id's like this: Start with gender then orientation then ageThe age part is concerning, I have a character fix of 2, eg. 10 to 99 I am doing in ten years like 10 to 20, 20 to 30, etc... but using a <= operator So person A looking for person B Person A is a male, straight, age<=20 One branch of the control statement is about 30 lines or less which doesn't seem bad, but that's 3 x 6 x 3 x 30 = ~ 170 lines of code which doesn't seem bad. I'm also concerned about using switch instead of a try-all-till-found sort of control system The multiplication mambo jambo over there is from the three specifications of a person: gender: male,female,both orientation: straight, lesbian, gay, bi, don't care to say, other date sought: male, female, both I realize too that this can be much better Already my form is ugly, there are 7 lines to be filled including username, email, password. Part II who has viewed who This is a matter of what works best or are they the same. I want the experience to be this: once you've passed a person eg. declared you weren't interested in him / her, you don't see them again, unless you want to. I'm not sure yet how I will generate a list, I know already that it won't be images, but numbers eg. text only, but how do you have a current list eg. when new members sign up after you have generated a list? This is more related above but... The thought is to create a separate table with at least three columns: id, user, user id viewed Can it be better than that? The problem here is that say 16 people exist on the website, then for each person to look at the other person, what is that 16 x 15 = 240 columns? Just from 16 people? Can it be better? Thanks for any suggestions Quote Link to comment https://forums.phpfreaks.com/topic/294362-dating-website-database-may-quickly-get-out-of-hand-as-well-as-list-generator/ Share on other sites More sharing options...
elemen121 Posted October 6, 2015 Share Posted October 6, 2015 Part 1) I'm not sure what you mean by a "control statement list generator". To query the database you would just put the parameters that a user is searching on in SQL Query. Part 2) A table with 3 columns expanding to "what is that 16 x 15 = 240 columns?" It might be 240 rows of data, I don't think it will get out of hand with a few hundred rows of data. Quote Link to comment https://forums.phpfreaks.com/topic/294362-dating-website-database-may-quickly-get-out-of-hand-as-well-as-list-generator/#findComment-1522433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.