I have a database called 'Telcel' and a table called 'calls' columns in my table are id,call_from,call_to,date_time,duration,network,cost,status
I have the following code:
$conn = mysqli_connect("localhost", "daven", "H3x^g0n", "Telcel");
$query = "SELECT id, COUNT(id), call_from,ROUND(SUM(cost), 2) FROM calls GROUP BY call_from ORDER BY COUNT(id) DESC;";
$result = mysqli_query($conn, $query);
while($row = mysqli_fetch_assoc($result))
{
echo '
<tr>
<td><a href="total.php">'. $row['call_from'] .'</a></td>
<td>'. $row['COUNT(id)'] .'</td>
<td>'. $row['ROUND(SUM(cost), 2)'] .'</td>
</tr>
';
}
which returns for example:
Call From Calls Cost
Shannon 10 50.2
Tom 3 7.6
I'd like when a name is selected to display all the calls, duration for each call and cost of each call made by the selected caller on the next page,So if Tom is selected display all the relevant information for Tom only, and if Shannon is selected same thing etc. Thank you.