Hi all,
I have a query pulling out dates from a database, these dates are then added to an array and inserted into a graph along the x-axis. From the results, there could be one value with one date or there could be 10 values with one date. This means that the data displayed on the x-axis is inconsistent. What I need to do is to add the unique dates ONLY to the array, which will allow the graph to have more clarity.
<?php
$get_testruns = mysql_query("SELECT testrun_id,logs,req_iter,comp_iter,tools FROM (testrun tr) left join log_servers ls on tr.log_servers_id = ls.log_servers_id WHERE test_codelevel_id='695259' ORDER BY end") or die(mysql_error());
$x = 0;
$y = 0;
while ($result = mysql_fetch_assoc($get_testruns)) {
$testrun_id = $result['testrun_id'];
$getdate = mysql_query("select end from testrun where testrun_id = '$testrun_id'") or die(mysql_error());
while ($date = mysql_fetch_assoc($getdate)) {
$end = $date['end'];
// Need something here to process unique dates
$formatted_date = date("d/m/Y",$end);
}
$req_iter = $result['req_iter'];
$comp_iter = $result['comp_iter'];
$arrData[$x][1] = $formatted_date; //x-axis
$arrData[$y][2] = $comp_iter; //y-axis
$x++;
$y++;
}
?>
Many thanks ;), Nonshatter x