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
https://forums.phpfreaks.com/topic/69126-php-to-echo-results/
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
https://forums.phpfreaks.com/topic/69126-php-to-echo-results/#findComment-347452
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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