Help with results output needed

From: Date: Wed, 11 Apr 2001 14:30:39 +0000
Subject: Help with results output needed
Groups: php.db 
Request: Send a blank email to php-db+get-8488@lists.php.net to get a copy of this message
Hi, first post :) I have an interesting project. I have a basic form passing answers into mysql. I have a db with multiple tables, each table contains several fields, but I am only concerned with 16 of these fields which contain the answers "A" "B" "C" "D" etc., not all fields contain the same number of answers (ie; some answers have A-G, some only have A-D to choose from). My problem is extracting the number of people that chose "A" for answer1, "B" for answer1, etc. Here is the layout: acct2301 (table) answer1-answer16 are my fields username answer1 answer2 answer3 answer4 answer16 ---------------------------------------------------- joeblow A F A E C someguy A E B B C joeuser B A E A D someone D C D A A I have everything completed as far as getting the answers into the tables,I just can't figure out the best way to extract the answers and determine how many chose a given answer for each question. I have seen some examples using count(*), and (sum) I am thinking I need to first determine how many A's, B's etc. then perform a count on the result of that, but that is as far as I have been able to get. Ideally a percentage function would be nice (20% chose A for Answer1, etc.) Thanks for any help, I sure need it! -Phil

« previous php.db (#8488) next »