El error es en php espera q te copio el codigo
Código PHP:
<?php require_once('Connections/prueba.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "listado.php" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE existencias SET ano_pblccn=%s, ttlo=%s, isbn=%s, nme=%s, ed=%s,glxia=%s, exmplrs=%s WHERE Id=%s",
GetSQLValueString($_POST['ano_pblccn'], "int"),
GetSQLValueString($_POST['ttlo'], "text"),
GetSQLValueString($_POST['isbn'], "varchar"),
GetSQLValueString($_POST['nme'], "text"),
GetSQLValueString($_POST['ed'], "int"),
GetSQLValueString($_POST['exmplrs'], "int"),
GetSQLValueString($_POST['glxia'], "int"),
GetSQLValueString($_POST['Id'], "int"));
mysql_select_db($database_prueba, $prueba);
$Result1 = mysql_query($updateSQL, $prueba) or die(mysql_error());
$updateGoTo = "listado.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE existencias SET ano_pblccn=%s, ttlo=%s, isbn=%s, nme=%s, ed=%s,glxia=%s, exmplrs=%s WHERE Id=%s",
GetSQLValueString($_POST['ano_pblccn'], "int"),
GetSQLValueString($_POST['ttlo'], "text"),
GetSQLValueString($_POST['isbn'], "varchar"),
GetSQLValueString($_POST['nme'], "text"),
GetSQLValueString($_POST['ed'], "int"),
GetSQLValueString($_POST['exmplrs'], "int"),
GetSQLValueString($_POST['glxia'], "int"),
GetSQLValueString($_POST['Id'], "int"));
mysql_select_db($database_prueba, $prueba);
$Result1 = mysql_query($updateSQL, $prueba) or die(mysql_error());
$updateGoTo = "listado.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
mysql_select_db($database_prueba, $prueba);
$query_rs_existencias = "SELECT existencias.Id, existencias.ano_pblccn, existencias.ttlo, existencias.isbn, existencias.nme,existencias.ed, existencias.exmplrs,existencias.glxia, existencias.rtrr FROM existencias ORDER BY ano_pblccn DESC";
$rs_existencias = mysql_query($query_rs_existencias, $prueba) or die(mysql_error());
$row_rs_existencias = mysql_fetch_assoc($rs_existencias);
$totalRows_rs_existencias = mysql_num_rows($rs_existencias);
?>
<html>
<head>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="gl-ES">
<style type="text/css">
<!--
.Estilo18 {font-family: Arial, Helvetica, sans-serif; font-size: 11px; }
.Estilo20 {font-family: Arial, Helvetica, sans-serif; font-size: 9px; }
.Estilo22 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 11px; }
-->
</style>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Listado Existencias do almacén</title>
</head>
<body>
<br><br><br><form name="form1" method = "POST" action = "resultados.php">
<strong><center align>Búsqueda na base de datos:
<input type="text" name="titulo" size="20">
<input type="submit" value="buscar">
</form>
<p> </p>
<p><a href="insertar2.php"> Insertar Novo rexistro</a> </br>
</p>
<p> </p>
<table width="100%" border="0" align= width="90%" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<td align=center width="3%"><span class="Estilo22"><font size="2px">Ano </span></td>
<td align=center width="30%"><span class="Estilo22"><font size="2px">Título</span></td>
<td align=center width="12%"><span class="Estilo22"><font size="2px">Autor </span></td>
<td align=center width="8%"><span class="Estilo22"><font size="2px">Isbn</span></td>
<td align=center width="2%"><span class="Estilo22"><font size="2px">Edición</span></td>
<td align=center width="4%"><span class="Estilo22"><font size="2px">Actualizar</span></td>
<td align=center width="4%"><span class="Estilo22"><font size="2px">Borrar</span></td>
<td align=center width="5%"><span class="Estilo22"><font size="2px">Existencias</span></td>
<td align=center width="5%"><span class="Estilo22"><font size="2px">Galaxia</span></td>
<td align=center width="7%"><span class="Estilo22"><font size="2px">Retirar</span></td>
<?php do { ?> <tr>
<td align=center bgcolor="#FFFFFF"><span class="Estilo18"><?php echo $row_rs_existencias['ano_pblccn']; ?></span></td>
<td align=center bgcolor="#FFFFFF"><span class="Estilo18"><?php echo $row_rs_existencias['ttlo']; ?></span></td>
<td align=center bgcolor="#FFFFFF"><span class="Estilo18"><?php echo $row_rs_existencias['nme']; ?></span></td>
<td align=center bgcolor="#FFFFFF"><span class="Estilo20"><?php echo $row_rs_existencias['isbn']; ?></span></td>
<td align=center bgcolor="#FFFFFF"><span class="Estilo18"><?php echo $row_rs_existencias['ed']; ?></span></td>
<td align=center bgcolor="#FFFFFF">
<form action="actualizar.php" method="post" name="form2" class="Estilo18">
<input type="hidden" name="Id" value="<?php echo $row_rs_existencias['Id']; ?>">
<input type="image" src="actualizar.jpg" name="Submit" value="Editar">
</form>
</td>
<td align=center bgcolor="#FFFFFF">
<form action="borrado.php" method="post" name="form2" class="Estilo18">
<input type="hidden" name="Id" value="<?php echo $row_rs_existencias['Id']; ?>">
<input type="image" src="papelera.jpg" name="Submit" value="Borrar">
</form>
</td>
<td align=center bgcolor="#FFFFFF"><span class="Estilo18"><?php echo $row_rs_existencias['exmplrs']; ?></span></td>
<td align=center bgcolor="#FFFFFF"><span class="Estilo18"><?php echo $row_rs_existencias['glxia']; ?></span></td>
<td align=center bgcolor="#FFFFFF"><form action="restar.php" method="post" name="form2" class="Estilo18">
<input name="numero" type="text" size="2" maxlength="3">
<input type="hidden" name="Id" value="<?php echo $row_rs_existencias['Id']; ?>">
<input type="submit" name="Submit" value="E">
</form></td>
<?php } while ($row_rs_existencias = mysql_fetch_assoc($rs_existencias)); ?></table>
</body>
</html>
<?php
mysql_free_result($rs_existencias);
?>
Asi me funciona todo correctamente, me lista la tabla con todos sus campos y sus aplicaciones como ingresar, actualizar, borrar etc... ahora lo que necesito es lo que te dije mostrar una nueva tabla a continuación con solo los ejemplares que sean menores a esa cantidad.