1
I have the following problem: I’m assembling a Highcharts chart with queries php
and I end up having a while inside another because the result of the date I put in the next query, has to return in a single query
?
<?php
include 'config.php';
$query="SELECT distinct data FROM lista";
$output = sqlsrv($query, $conn);
while($row = sql_srv_fetch_array($output)){
$query2="SELECT MATERIAL FROM lista WHERE data='".$row['data']."'";
$output2 = sqlsrv($query2, $conn);
while($row2 = sql_srv_fetch_array($output2)){
echo $row['MATERIAL'];
}
}
?>
I want to return a query only that returns the date column of the form [data1,data2,data3,....,dataN]
and material column of the shape [material1,material2,material3,...,materialN]
. How to ride that one select
?
You can’t just pick up the materials with their respective dates?
– Darlei Fernando Zillmer