I am trying to make a call to the database so it displays a list with certain information, but for some reason it isn't working even though the same code was working before with other database.
It displays the following error:
Fatal error: Call to undefined function displayLabs() in C:\wamp\www\MyFirstProyect\labs.php on line 258
This is the code:
function getLabs(){
$query = "SELECT bk.idlab , bk.capacidad, bk.carrera, bk.ubicacion FROM labs as bk";
$result = do_query($query);
return $result;
}
function displayLabs(){
$labs = getLabs();
while($row = mysql_fetch_assoc($labs)){
echo '<ul>' .
'<li>"Nombre: "' . $row['idlab'] . '</li>' .
'<li>"Capacidad: "' . $row['capacidad'] . '</li>' .
'<li>"Carrera: "' . $row['carrera'] . '</li>' .
'<li>"Ubicación: "' . $row['ubicacion'] . '</li>' .
'</ul>';
}
}
Just in case this is html:
<div class="popUp1" id="popUpCorrecto1">
<div class="estiloPopUp">
<span>Información de laboratorio</span>
<span value="Cerrar" id="btnCerrar">x</span>
</div>
<?php displayLabs() ?>
<input type = "button" value = "Eliminar" id = "btnEliminar" onclick="window.location='labEliminado.html';" />
<input type = "button" value = "Modificar" id = "btnModificar" onclick="window.location='modificarLab.html';" />
</div>
Any help would be very much appreciated.
EDIT: Something Mr.Fred told me gave me an idea and it worked, now it is displaying the information, BUT not of just one "Lab" But all of them XD So with the 4 test labs I entered into the database it is making 5 lists.
I guess I need to figure some kind of filter.