Crear una web de consulta en PHP
Hola a todos
tengo un problemita el cual consiste en q he creado una pag en php y lo he enlazado a una db de acces s y hasta ahi todo es perfecto pero cuando en mi consulta no u tilizo el where pero cuando quiero utilizar el where ese es mi problema ya q no me sale ningun dato, lo q quiero realizar es hacer una consulta x ruc y q me aparescan todos los productos de ese ruc aca les dejo el codigo para q vean cual es mi error
<code><html><head><center><strong><h1>Stock Disponible</h1></strong></center><title></title></head><body>
<p align="center">
<strong>
<?php
// Configuración regional
setlocale(LC_ALL,'esn');
echo 'Actualizado al ';
echo strftime("%A, %d de %B de %Y",getlastmod());
echo strftime(" - %H:%M.%S",getlastmod());
?>
</strong>
</p>
<form method="post" action="index3.php">
<label><strong>Código:</strong></label>
<input name="txtCodigo" type="text" value="10410477713">
<input name="btnConsultar" type="submit" value="Consultar">
</form>
<p>&nbsp;</p>
<table width="960" border="1">
<tr>
<th width="226" bgcolor="#CCCCCC" scope="col"><div align="center">Tarjeta</div></th>
<th width="247" bgcolor="#CCCCCC" scope="col"><div align="center">Simbolo</div></th>
<th width="230" bgcolor="#CCCCCC" scope="col"><div align="center">Cliente</div></th>
<th width="229" bgcolor="#CCCCCC" scope="col"><div align="center">Disponible</div></th>
</tr>
<?php
// if(isset($btnConsultar))
// {
// echo "bye";
require_once('odbc.php');
$query = odbc_exec($odbc, "SELECT * FROM stock WHERE ruc ='$txtCodigo'") or die ( odbc_errormsg());
while($row = odbc_fetch_array($query))
{
echo "<tr><td>".$row['tarjeta']."</td><td>".$row['simbolo']."</td><td>".$row['cliente']."</td><td> ".$row['disponible']."</td></tr>";
}
odbc_close($odbc);
// }
// else
// {
echo $txtCodigo;
// }
?>
</table>
<p>&nbsp;</p>
<p>&nbsp; </p>
</body>
</html>
</code>
de antemano se los agradesco
zigotica
$txtCodigo no estará vacio, ¿no? haz un echo de $txtCodigo y si está vacio puede ser un problema de los global, que estarán en off.