Tema: consulta
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/02/2006, 18:06
Edsinho
 
Fecha de Ingreso: julio-2005
Mensajes: 78
Antigüedad: 18 años, 10 meses
Puntos: 0
Pregunta consulta

hola tengo lo siguiente y solo me muestra un registro y cuando hago una consulta en phpmyadmin cuando realizo la consulta me dan 2 registros espero que alguien me ayude a saber por que razon.

<?php
require_once 'funcionesdb.php';
$sql = "SELECT NomPro, sum(CanArt) as Cantidad, sum(CanArt*PreCom) as Total
FROM proveedor, compra, comart
WHERE compra.CveCom = comart.CveCom
AND compra.CvePro = proveedor.CvePro
GROUP BY NomPro";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
?>

<table width="65%" align="center">
<th bgcolor="#999999" >Nombre del Proveedor</th>
<th bgcolor="#999999" >Total de Articulos </th>
<th bgcolor="#999999">Importe Total </th>

<?php
while( $row = mysql_fetch_array($result))
{
$pre_mod = number_format($row['Total'],2);
echo '<tr><td width="150" align="center" height="40">'.$row['NomPro'].'</td>';
echo '<td width="100" align="center" height="40">'.$row['Cantidad'].'</td>';
echo '<td width="200" align="center">'.$pre_mod.'</td></tr>';
}
?>