Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/06/2012, 08:31
unasemana
 
Fecha de Ingreso: julio-2005
Mensajes: 7
Antigüedad: 19 años, 8 meses
Puntos: 0
Se me multiplica la consulta de 2 tablas

Hola que tal,

tengo un pequenio problema al hacer una consulta a 2 tablas de mi base de datos.

Al realizar la consulta se me repiten los campos 2 veces, es ddecir :

Código:
35 	Y2K 	Batman 	1.00 	1000.00 	1120.00 	aprobado
34 	h1n1 	y2k 	1.00 	1000.00 	1120.00 	APROBADO
35 	Y2K 	Batman 	1.00 	1000.00 	1120.00 	aprobado
34 	h1n1 	y2k 	1.00 	1000.00 	1120.00 	APROBADO
el codigo que utilizo es este:

Código:
<?php 
// conectar al servidor

$connect = mysql_connect ("localhost","nimopart_invoice","invoices");

//conectar bd

mysql_select_db ("nimopart_invoices");

// buscar en bd
$query = mysql_query ( "SELECT * FROM mcb_invoice_items, mcb_invoice_item_amounts WHERE invoice_item_custom_1 = 'aprobado' ");

//atrapar resultados y mostrar

 WHILE ($columnas = mysql_fetch_array($query)):

$invoice_id = $columnas ['invoice_id'];
$item_name = $columnas ['item_name'];
$item_description = $columnas ['item_description'];
$item_qty = $columnas ['item_qty'];
$item_price = $columnas ['item_price'];
$item_total = $columnas ['item_total'];
$invoice_item_custom_1 = $columnas ['invoice_item_custom_1'];


echo "  
    <tr>  
      <td width='150'>".$columnas['invoice_id']."</td>  
      <td width='150'>".$columnas['item_name']."</td>  
      <td width='150'>".$columnas['item_description']."</td>
          <td width='150'>".$columnas['item_qty']."</td>
          <td width='150'>".$columnas['item_price']."</td>
          <td width='150'>".$columnas['item_total']."</td>
           <td width='150'>".$columnas['invoice_item_custom_1']."</td>     

    </tr>  
"; 




  endwhile;
?>
que puedo hacer para que no se me multiplique?, los nombres de las tablas son: mcb_invoice_items y mcb_invoice_item_amounts