Ver Mensaje Individual
  #20 (permalink)  
Antiguo 30/05/2008, 10:16
Avatar de T4ke0veR
T4ke0veR
 
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Respuesta: error mysql_fecth_assoc

con las dos consultas
http://indexa.com.ve/latiendadelpintor/admin/prueba.php
Código PHP:
<?php    
include ('conect.php');   

$sqlex="SELECT 'email', COUNT(*) AS 'total', SUM('monto') AS 'suma' FROM 'factura' GROUP BY 'email'";   
$sql_execex=mysql_query($sqlex) or die( "Error en consulta: $sql_execex, error: " mysql_error());
while(
$rowex=mysql_fetch_assoc($sql_execex))   
{    
$email $rowex['email'];
if( empty( 
$email ) ) {
        die( 
"no existe el email: $email, datos: " print_r$rowextrue ) );
}
$sqlexz="SELECT * FROM clientes WHERE email=".$email
$sql_execexz=mysql_query($sqlexz) or die( "Error en consulta: $sqlexz, error: " mysql_error());  
$datoscli mysql_fetch_assoc$sql_execexz );
?>  

<table width="955" border="0" cellspacing="0" cellpadding="0">   
  <tr>   
    <td><table width="200" border="1" bgcolor="#999999">   
      <tr>   
        <td width="80" bgcolor="#FFFFFF"><?php echo $rowex['suma']; ?></td>   
          <td width="80" bgcolor="#FFFFFF"><?php echo $rowex['total']; ?></td>   
          <td width="40" bgcolor="#FFFFFF"><?php echo $rowexz['email']; ?></td>   
        </tr>  
      </table>  
      <?php }?>      
      <p>&nbsp;</p> 
    <p>&nbsp;</p></td>   
  </tr>
con una
http://indexa.com.ve/latiendadelpint...in/prueba2.php
Código PHP:
<?php 
include ('conect.php');

$sql="SELECT `email`, COUNT(*) AS 'total', SUM(`monto`) AS 'suma' FROM `factura` GROUP BY `email`";
$sql_exec=mysql_query($sql);
while(
$row=mysql_fetch_assoc($sql_exec))
{
?>
<table width="200" border="1">
  <tr>
    <td><?php echo $row['suma']; ?></td>
    <td><?php echo $row['total']; ?></td>
    <td>&nbsp;</td>
  </tr>
</table>

<?php
}
?>
S.O.S. =/
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...