Jump to content

PHP to echo results


TheFilmGod

Recommended Posts

This may seem very complicated, but I have a list of members from student council. Each has a record of attendance in their own column. (Each row is a different meeting). How can I query the database with php to count how many e's u's and p's there is in a column? How can I do a simple loop to do this and repeat it over many times?

 

e stands for excused

u stands for unexcused

p ............. present

Link to comment
Share on other sites

Before you see the table structure, I will tell you that the way I made it is extremely efficient. It works good for me.

 

ATTENDANCE:

 

id | date | a1 | a2 | a3 | a4 | a5 ..... | a43

 

Id is auto increment. Date is the meeting date. A1 ... A43 is the students in student council. Each have a column for attendance.

 

All I want is to go through each members, a1 .. a43 columns and calculate number of e , u , p for each of them. So something like this.

 

$a1[e] = 5;

$a1 = 6;

$a1[p] = 1;

 

Representing: 5 excused, 6 unexcused, and 1 present for member a1.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.