PHP - OTRO PROBLEMITA

 
Vista:

OTRO PROBLEMITA

Publicado por chavez (23 intervenciones) el 07/08/2008 20:27:04
TENGO ESTO

//Fetch all factory records
$strQuery = "select * from reportes, proyectos where reportes.idproyecto = proyectos.id";
$result = mysql_query($strQuery) or die(mysql_error());
$i=0;
//Let's store the sales data for 6 products in our array. We also store the name of products.
//Store Name of Products
if ($result) {
$total = 0;
while($ors = mysql_fetch_array($result)) {

$arrData[$i][1] = $ors['empresa'];


$arrData[$i][2] = $ors['dias'];
$ssql = mysql_query("SELECT * FROM edicion WHERE idreporte = ".$ors['idreporte']);
$total = "0";
while($row = mysql_fetch_object($ssql)){
$total = $total + $row->dias;
}

$arrData[$i][3] = $total;
$i++;
}
}

lo que me interesa es no repetir el nombre de la empresa sino simar $ors['dias']; para todoas las empresas que tengan el campo IDEMPRESA igual, no se si con GROUP...............ayuda
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder