Thanks for your reply Bruce,
It seems that nandina is not the problem. I belive that the function mysql_fetch_array($result) does not work well with php4. However here´s the complete code... once again thank you!
<body>
<?php
function gettrm($nandina, $tipo){
$db = mysql_connect("localhost", "gfkust", "kashjandskj");
mysql_select_db("shflsafjlfsf",$db);
$result = mysql_query("SELECT * FROM indicadores WHERE nandina=$nandina");
$myrow = mysql_fetch_array($result);
if ($tipo==0){
$impo97 = $myrow["impo97"];
return $impo97;
}
if ($tipo==1){
$expo97 = $myrow["expo97"];
return $expo97;
}
if ($tipo==2){
$descripcion = $myrow["descripcion"];
return $descripcion;
}
}
if ($submit) {
// process form
while (list($value) = each($HTTP_POST_VARS)) {
}
$tipo=0;
$ans = gettrm($nandina, $tipo);
printf("<B>El total de las importaciones en 1997 para la subpartida %s fue de USD $ %s\n</B><br>",$nandina,$ans);
}
if ($submit1) {
// process form
while (list($value) = each($HTTP_POST_VARS)) {
}
$tipo=1;
$ans = gettrm($nandina,$tipo);
printf("<B>El total de las exportaciones en 1997 para la subpartida %s fue de USD $ %s\n</B><br>",$nandina,$ans);
}
if ($submit2) {
// process form
while (list($value) = each($HTTP_POST_VARS)) {
}
$tipo=2;
$ans = gettrm($nandina,$tipo);
printf("<B>La subpartida %s corresponde a: %s\n</B><br>",$nandina,$ans);
}
else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Código Nandina: <input type="Text" name="nandina"><br>
<input type="submit" name="submit" value="Impo97">
<input type="submit" name="submit1" value="Expo97">
<input type="submit" name="submit2" value="Descripción">
</form>
<?php
} // end if
?>
</body>
Sergio