in my PHP script i make a mysql_query :
$full_alarm_sql = "
SELECT alarms.id, alarms.date, clients.name, clients.number, alarms.controller, alarmstype.type,
alarms.alarmstatus, alarms.starttime, alarms.endtime, DATEDIFF(CURDATE(), alarms.date) AS difference
FROM alarms
LEFT JOIN clients ON alarms.clientid = clients.id
LEFT JOIN alarmstype ON alarms.typeid = alarmstype.id
WHERE DATEDIFF(CURDATE(), alarms.date) <=" . $type . " AND clients.number = " . $market;
$full_alarm_query = mysql_query($full_alarm_sql);
and then i make a while loop inside a table with the fetching of the query :
while ($full_alarm_fetch = mysql_fetch_array($full_alarm_query)) {
$content .=
"
<tr>
<td>" . $full_alarm_fetch['date'] . "</td>
<td>" . $full_alarm_fetch['number'] . " | " . $full_alarm_fetch['name'] . "</td>
<td>" . $full_alarm_fetch['controller'] . "</td>
<td>" . $full_alarm_fetch['type'] . "</td>
<td>" . $full_alarm_fetch['alarmstatus'] . "</td>
<td>" . $full_alarm_fetch['starttime'] . "</td>
<td>" . $full_alarm_fetch['endtime'] . "</td>
</tr>";
$client_name = $full_alarm_fetch['name'] . ' | ' . $full_alarm_fetch['number'];
}
and then i need to use
$full_alarm_fetch['name'] . ' | ' . $full_alarm_fetch['number'];
so the way i'm doing it now just doesn't seem the best way, meaning the variable inside the while loop is overwritten time and time again until the loop dies and than i can user the fetch information.
i was wondering if there is a better/efficient way of doing what i'm trying to do.
thanks in advance.