Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/04/2015, 14:36
Avatar de gerrycrush
gerrycrush
 
Fecha de Ingreso: abril-2015
Ubicación: Mexico
Mensajes: 9
Antigüedad: 9 años
Puntos: 0
Exclamación Error de MySQL: Not unique table/alias: ''

Hola, espero mu puedan ayudar con este error, no se si este bien utilizado el Inner Join:

Error:

Error de MySQL: Not unique table/alias: 'productoenpedido'etc


Código PHP:
function Footer()
{
    
$this->SetY(-15);
    
$this->SetFont('Arial','B',8);
    
$this->Cell(50,10,'Carrito',0,0,'L');
}


    
$cliente$_GET['id'];
    
$con = new DB;
    
$cliente $con->conectar();    
    
    
$strConsulta "SELECT * from cliente where id_cliente =  '$cliente'";
    
    
$cliente mysql_query($strConsulta);
    
    
$fila mysql_fetch_array($cliente);

    
$pdf=new PDF('p','mm','legal');
    
$pdf->Open();
    
$pdf->AddPage('P''legal');
    
$pdf->SetMargins(3,0,10);
    
$pdf->Ln(10);

    
$pdf->SetFont('Arial','',10);
    
$pdf->Cell(0,6,'Clave: '.$fila['id_tipocliente'],0,1);
    
$pdf->Cell(0,6,'Nombre: '.$fila['NombreContacto'].' '.$fila['ApellidosContacto'].' '.$fila['NombreComercial'],0,1);
    
$pdf->Cell(0,6,'Id: '.$fila['id_cliente'],0,1); 
    
$pdf->Cell(0,6,'Carrito: '.$fila[$_GET['id']],0,1); 
    
    
$pdf->Ln(10);
    
    
$pdf->SetWidths(array(5550555020));
    
$pdf->SetFont('Arial','B',10);
    
$pdf->SetFillColor(85,107,47);
    
$pdf->SetTextColor(255);

        for(
$i=0;$i<1;$i++)
            {
                
$pdf->Row(array('Cantidad''Descripcion''Precio unitario''Descuento unitario''Importe'));
            }
    
    
$historial $con->conectar();    
    
$strConsulta "SELECT productoenpedido.Cantidad, articulo.id_descripcion, productoenpedido.PrecioUnitario, productoenpedido.Descuento, productoenpedido.PrecioLista 
    FROM productoenpedido
    Inner Join productoenpedido ON articulo.id_cliente = productoenpedido.id_pedido 
    Inner Join cliente ON pedido.id_pedido = cliente.id_cliente
    WHERE cliente.id_cliente = '$cliente'"
;
    
    
$historial mysql_query($strConsulta)or die("Error de MySQL: ".mysql_error());;
    
$numfilas mysql_num_rows($historial);

    
    for (
$i=0$i<$numfilas$i++)
        {
            
$fila mysql_fetch_array($historial);
            
$pdf->SetFont('Arial','',10);
            
            if(
$i%== 1)
            {
                
$pdf->SetFillColor(153,255,153);
                
$pdf->SetTextColor(0);
                
$pdf->Row(array($fila['Cantidad'], $fila['id_descripcion'], $fila['PrecioUnitario'], $fila['Descuento'], $fila['PrecioLista']));
            
            }
            else
            {
                
$pdf->SetFillColor(102,204,51);
                
$pdf->SetTextColor(0);
                
$pdf->Row(array($fila['NombreContacto'], $fila['ApellidosContacto'], $fila['Usuario'], $fila['Total']));
                
                
            }
        }