Hi all,
I am working on a script that returns multiple rows of data from a table. What I would like to do is to count the number of times a number occures in each row.
Example:
Row1: 1,2,4,3,3,2 // three occures twice
Row2: 4, 2, 1,4,4 // four occures three time
The column names I want to use are:
$_row['OverallSatisfaction'];
$_row['CheckIn'];
$_row['Employees'];
$_row['Room'];
$_row['CheckOut'];
Currently; my $score array contains all the columns from the table but I oly want to use the data from columns 4,5,6,7,8 working on the principle that the array starts at 0
The result from my SQL Query is:
Array ( [0] => Array ( [0] => 2700 [RecordID] => 2700 [1] => 2017-06-13 [FeedBackDate] => 2017-06-13 [2] => 3503 [FeedBackRoomNo] => 3503 [3] => Smith [GuestName] => Smith [4] => 2 [OverallSatisfaction] => 2 [5] => 4 [CheckIn] => 4 [6] => 3 [Employees] => 3 [7] => 3 [Room] => 3 [8] => 4 [CheckOut] => 4
$scroe = array();
while($row=mysql_fetch_array($result))
{
$score[]=$row;
}
}
The issue I am having is my "while" loop $Score array contains all the returned data. How can I only place object4, 5, 6, 7 and 8 into the $score array.
Or; am I doing this completly wrong.
Many thanks in advance for your time.