Jump to content

SaranacLake

Members
  • Content Count

    648
  • Joined

  • Last visited

Community Reputation

4 Neutral

About SaranacLake

  • Rank
    Prolific Member

Profile Information

  • Gender
    Male
  • Location
    New York
  • Age
    40

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @Barand Sorry for the late response, but I have been tied up with another part of my website for the last week or so.... Thanks for the sample array above! I am trying to get my head back into things, and am sure I will have follow-up questions. Q1.) For starters, in your multi-dimensional array above, 'title', 'intro', and 'sections' are [keys[/b] for the outermost array, right? Q2.) I forgot, what do you call arrays where the keys are text values like your example? Associative arrays? Q2b.) And what do you call arrays where the keys are numeri
  2. I still hate arrays! πŸ™ Could use some help expanding an array by adding another dimension. (I'm sure this will be super simple for the gurus here!) Currently I have an array that holds my questionnaire questions (HMTL-formt) like this... questionnaireArray array 1 => <li>Question-1 here</li> 2 => <li>Question-2 here</li> 3 => <li>Question-3 here</li> 4 => <li>Question-4 here</li> I want to expand this PHP page so that a series of questions are part of a "Section" that m
  3. Good to know. I suppose that I will open many new doors once I learn Javascript?! Hopefully I can get to that later this year or next...
  4. VERY impressive, I must say! 1.) Is that open-source? (I might not feel so bad "cheating" and using someone else's library as long as it is NOT from Google or some other evil corporation!) 2.) So I guess I'd need to know how to do Javascript, right? 3.) And I'd need to know how to use JSON? (Have heard of that but have no clue what it is?!) Thanks for the tip! πŸ‘
  5. True, but even I make mistakes, and guard-rails can be nice. Good point, so let me re-state. I have a "question_type" table that would define a question as say "rating-5pt". To your point, I could store a "5" in the "question_type" lookup so that as I add in hundreds of questions, I am always pulling that "5" from the lookup table thus eliminating the issue I believe you are pointing out. To your earlier question... What could happen? Well, I could end up with an UN-balanced set of choices (e.g. 1-Strongly Disagree, 2-Disagree, 3-Neither, 4-Agree) with "5-Strong
  6. Hello. This problem deals with survey questions and their corresponding answer-choices. Let's say I have a satisfaction scale like this... 1 - Strongly Disagree 2 - Disagree 3 - neither 4 - Agree 5 - Strongly Agree I created a new table called "answer_group" to bind together a bunch of related choices... answer_group -||-----|<- answer Here is what I want to happen... In the "answer_group" table, for a given "answer group" (record) there would be a column called: "no-of-choices" and it would have a value like "5". I want MySQL to look at
  7. Yes, I agree that is the harder part. @Barand, WOW! I am blown away by your example below! That is a super good-looking horizontal bar chart! As you mentioned, it takes more work to get adjustable scales, titles, etc, but I think what you have below is more than sufficient for my needs. And I think most users would appreciate a "visual", even if it is a simple one, because that is all I think most people want. I will put your code in my hat to use after I go live with my website. Thanks for the headstart! πŸ‘
  8. Good to hear! Well, not entirely true. It is possible to collect data, but not have it normalized properly, and end up with a real PITA. But data modeling is my strength, and I think I have a good data model. (My only issue is that I am the king of "scope creep", and every time I build something or fix something - like my survey data validation thanks to @maxxd suggestion - I get the urge to add on more functionality! I can see a few things in my current data model that could be a pain down the road, so i am thinking a few steps ahead and making sure my database is
  9. Well, I don't know exactly what I need since I don't know how to create a bar chart from scratch yet! After posting, here is what I came up with in my head... - In MySQL, create a query using COUNT( ) and GROUP BY to get a query-set that contains the 5 stubs and their count values. 1, Strongly Disagree, 7 2, Disagree, 10 3, Neither, 12 4, Agree, 25 5, Strongly Agree, 41 - Then pull that into a multi-dimensional array in PHP - Then iterate through that array / multi-dimensional array and build my bar chart. In general, does that sound like a good start?
  10. This question is part PHP, part MySQL. I have a survey_responses table... - id - survey_id - question_id - member_id - response For satisfaction questions (i.e. 1 = Strongly Disagree, 2 = Disagree, 3 = Neither, 4 = Agree, 5 = Strongly Agree), I'm trying to figure out how to get the counts for each of those responses into PHP so I can then feed them to a Bar Chart I hope to create with HTML/CSS. 1.) Should I create some kind of loop in PHP, and look for each value (e.g. 1 = Strongly Disagree) and one at a time plug them into variables called: $stronglyDisag
  11. Not sure if I follow completely what you mean - as in how many nested IF-THEN-ELSE's? Although, I think my IF-THEN-ELSE's would make you turn to violence?! ☺️ I have IF-THEN-ELSE's that cover the majority of some of my scripts, and so they can be well over 1,000 lines of code. (Surprisingly, I have become very adept at reading them, but I'm sure there is an easier way!) Not so much a "God class", but rather a particular "use-case". trouble is, the start-to-finish path of a use-case is often well over 1,00 lines of code. Most of my scripts average 800-1,500 lines of
  12. @maxxd I was able to take your advice and write a block of code to do what you suggested last night. have gotten error message starting to appear for some question types, but now I need to figure out how to logically incorroate this new code into my old code base which is going to be a bear - but I am getting there!
  13. Not just functions - all of my code. The way I learned to code is procedurally, so I code things based on what you want to do. For instance, my "article.php" script - which displays an article and user comments below and all functionality related to that is a little over 3,000 lines of PHP, because I coded some "use-case" as a single script. (Not the way OOP works.) Bingo! if you were almost done with a decade long project, would you go in and tweak some section for fear it could cascade and break thousands of lines of code? (Of course that can apply to any large sy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.