Ver Mensaje Individual
  #8 (permalink)  
Antiguo 06/03/2014, 12:55
Karen_mBrK
 
Fecha de Ingreso: enero-2014
Mensajes: 127
Antigüedad: 10 años, 3 meses
Puntos: 2
Respuesta: [problema] mostrar datos con un inner join

Ok, prueba así, solo para ver que nos trae:

Código PHP:
<?php
  $link 
= @mysql_connect("localhost""root","")
                or die (
"Error al conectar a la base de datos.");
                @
mysql_select_db("clientes"$link)
                or die (
"Error al conectar a la base de datos.");

                
$query "SELECT * from empresas INNER JOIN sistemas ON empresas.codigo=sistemas.pertenece_a";
                
$result mysql_query($query);
                while(
$row mysql_fetch_array($result))
    {
echo 
'<strong>CLIENTE: </strong> <br>';
echo 
'<strong>SISTEMA</strong><br>';


    do {        
$row['codigo']."<br>";
$row['sistema']."<br>";

 }     while (
$row mysql_fetch_assoc($result)); } 
        
mysql_free_result($result);
    
?>