
18/03/2010, 05:04
|
| | Fecha de Ingreso: marzo-2010
Mensajes: 5
Antigüedad: 15 años Puntos: 0 | |
Respuesta: ayuda con alta.php Ani, he insertado el comando mysql_num_rows pero no saco nada en claro:
<?php
include("conexio.php");
if (isset($_REQUEST['alta']))
{
if ($_REQUEST['tan']=="")
{
echo ("No pots deixar el camp en blanc<br>");
echo ("<a href=alta_tancament.php>Tornar</a>");
}
else
{
$prova=mysql_query("select * from Tancament where IDTancament=".$_REQUEST['idtan']." AND Tancament=".$_REQUEST['tan']."<br>");
if(mysql_num_rows($prova) >0)
{
echo("el tancament ja existeix");
}
else
{
$result=("insert into Tancament values ('".$_REQUEST['idtan']."','".$_REQUEST['tan']."')");
if ( ! $resul=mysql_query($result))
{
echo "No s'ha pogut realitzar la consulta";
echo mysql_error();
echo ("<a href='alta_tancament.php'>Tornar </a>");
exit;
}
else
{
echo("Alta de tancament realitzada correctament");
echo ("<a href='gestio_tancament.php'>Tornar </a>");
}
}
}
}
else
{
?>
<html>
<center><h3>Alta de tancament</h3>
<form method='GET' action='alta_tancament.php'>
IDTancament:<input type='text' name='idtan' disabled><br><br>
<input type='hidden' name='idtan' ><br><br>
Tancament:<input type='text' name='tan' maxlength='20'><br><br>
<input type='SUBMIT' name='alta' value='Alta_tancament'>
<a href='gestio_tancament.php'>Tornar </a>
</form></center>
</html>
<?php
}
?>
Esta bien? |