Does not show records with NULL fields (QUERIES)

0

Good evening I make a form that works as a computer equipment log, in my BD I have null fields (I have no problem with the insertion).

The problem I have is that in mi modulo de consultas I do not see those records if there are null fields and I need to show them in my form regardless of whether or not there are null fields since I need to visualize all the records that have been stored, I want to think that it is by the Inner Join (since I have fields in foreign tables) since before putting it if I visualized all the records.

Thanks

Structure of my table

id_prestamo         PK  
fecha1  
hora1   
descripcion
id_usuario          FK
id_departamento     FK
id_entrega          FK
fecha2                  NULL
hora2                   NULL
id_ingeniero        FK  NULL
id_recepcion        FK  NULL

Code of the Consultation Module

<?php

			    require("connect_db.php");
				//$sql=("SELECT * FROM prestamo order by id_prestamo");
				
				
				$sql=("SELECT ps.id_prestamo, ps.fecha1, ps.hora1, ps.descripcion, usr.nombre, dep.descripcion, ent.descripcion, ps.fecha2, ps.hora2, ing.descripcion, rcp.descripcion
				FROM prestamo ps
				INNER JOIN usuarios usr  ON usr.id_usuario = ps.id_usuario
				INNER JOIN departamento dep ON dep.id_departamento = ps.id_departamento
				INNER JOIN entrega ent ON ent.id_entrega = ps.id_entrega
				INNER JOIN ingeniero ing ON ing.id_ingeniero = ps.id_ingeniero
				INNER JOIN recepcion rcp ON rcp.id_recepcion = ps.id_recepcion order by id_prestamo");
				
				
	
//la variable  $mysqli viene de connect_db que lo traigo con el require("connect_db.php");
				$query=mysqli_query($mysqli,$sql);

				echo "<table border='2'; class='table table-hover';>";
					echo "<tr class='warning'>";
					   echo "<td>ID del Equipo</td>";
						echo "<td>Fecha  de  Inicio</td>";
						echo "<td>Hora Inicio</td>";
						echo "<td>Descripción</td>";
						echo "<td>Usuario</td>";
						echo "<td>Departamento</td>";
						echo "<td>Estatus Entrega</td>";
						echo "<td>Fecha de Entrega</td>";
						echo "<td>Hora Fin</td>";
						echo "<td>Ingeniero</td>";
						echo "<td>Estatus Recepción</td>";
						echo "<td>Editar </td>";
						
					echo "</tr>";

			    
			?>
			  
			<?php 
				 while($arreglo=mysqli_fetch_array($query)){
				  	echo "<tr class='success'>";
				    	echo "<td>$arreglo[0]</td>";
				    	echo "<td>$arreglo[1]</td>";
				    	echo "<td>$arreglo[2]</td>";
				    	echo "<td>$arreglo[3]</td>";
				    	echo "<td>$arreglo[4]</td>";
						echo "<td>$arreglo[5]</td>";
						echo "<td>$arreglo[6]</td>";
						echo "<td>$arreglo[7]</td>";
						echo "<td>$arreglo[8]</td>";
						echo "<td>$arreglo[9]</td>";
						echo "<td>$arreglo[10]</td>";
						

				    	echo "<td><a href='actualizar_prestamo.php?id_prestamo=$arreglo[0]'><img src='images/actualizar.gif' class='img-rounded'></td>";
						
						

						
					echo "</tr>";
				}


			?>
    
asked by Carlos 14.06.2018 в 03:15
source

0 answers