TheFilmGod Posted September 13, 2007 Share Posted September 13, 2007 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 More sharing options...
trq Posted September 13, 2007 Share Posted September 13, 2007 What is your table structure? And some sample data of what a filed might look like would help. Link to comment https://forums.phpfreaks.com/topic/69126-php-to-echo-results/#findComment-347443 Share on other sites More sharing options...
TheFilmGod Posted September 13, 2007 Author Share Posted September 13, 2007 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 More sharing options...
TheFilmGod Posted September 13, 2007 Author Share Posted September 13, 2007 Alright, how do I retrieve info from a column using php. LIke mysql_fetch_assoc does a row, what about a column? ??? HELP !!! Link to comment https://forums.phpfreaks.com/topic/69126-php-to-echo-results/#findComment-347466 Share on other sites More sharing options...
samoht Posted September 13, 2007 Share Posted September 13, 2007 couldn't you just query that column and set it into an array? Link to comment https://forums.phpfreaks.com/topic/69126-php-to-echo-results/#findComment-347472 Share on other sites More sharing options...
TheFilmGod Posted September 13, 2007 Author Share Posted September 13, 2007 how? I do rows --> arrays not columns to arrays. Its much different. Link to comment https://forums.phpfreaks.com/topic/69126-php-to-echo-results/#findComment-347482 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.