Where is the error ???
Posted: Fri Mar 14, 2003 5:56 am
<HTML>
<HEAD>
<TITLE>leepersonal.php</TITLE>
<Link rel= "stylesheet" href="default.css">
</HEAD>
<BODY>
<h1><div align="left"><u>Datos Personales</u></div></h1>
<?
echo "<form name='modificar' method=post action='grabamodi.php'>";
$hostname = "localhost";
$username = "xx";
$password = "xxx";
$dbName = "auth";
MySQL_CONNECT($hostname,$username,$password) or DIE("DATABASE NO RESPONDE");
mysql_select_db($dbName)or DIE("Tabla no disponible");
$result=mysql_db_query("auth","select * from Personal1");
$number = MySQL_NUM_ROWS($result);
echo $number;
echo "<table width=400 align=center border=2 bgcolor='#F0FFFF' cellpadding=1 cellspacing=1 >";
echo "<td align=left>Legajo</td>";
echo "<td align=left>Nombre</td>";
echo "<td align=left>Interno</td>";
echo "<td align=left>Mail</td>";
$size = 1;
while($size <= $number)
{
$row=mysql_fetch_row($result);
echo "
<tr>
<td><input type=text size=3 name=leg".$size." value=$row[3]></td>
<td><input type=text size=25 name=nom".$size." value=$row[1]></td>
<td><input type=text size=8 name=int".$size." value=$row[4]></td>
<td><input type=text size=20 name=email".$size." value=$row[5]>
</tr>";
$size++;
}
echo"</table>";
mysql_close;
?>
<td colspan=5 ><br><input type=submit value='Modificar'>
<input type=hidden name=vuelta value='personaleditor.php'>
</FORM>
</BODY>
</HTML>
<?
$hostname = "localhost";
$username = "xxx";
$password = "xxx";
$dbName = "auth";
MySQL_CONNECT($hostname,$username,$password) or DIE("DATABASE NO RESPONDE");
mysql_select_db($dbName)or DIE("Tabla no disponible");
$result=mysql_db_query("auth","select * from Personal1");
$number = MySQL_NUM_ROWS($result);
$size = 1;
while($size <= $number)
{
$sSQL="Update Personal1 Set Nombre=$nom".$size.", Interno=$int".$size.", email1=$email".$size." where Legajo=$leg".$size."";
mysql_db_query("auth",$sSQL)or DIE("Error al grabar");
$size++;
}
mysql_close;
<HEAD>
<TITLE>leepersonal.php</TITLE>
<Link rel= "stylesheet" href="default.css">
</HEAD>
<BODY>
<h1><div align="left"><u>Datos Personales</u></div></h1>
<?
echo "<form name='modificar' method=post action='grabamodi.php'>";
$hostname = "localhost";
$username = "xx";
$password = "xxx";
$dbName = "auth";
MySQL_CONNECT($hostname,$username,$password) or DIE("DATABASE NO RESPONDE");
mysql_select_db($dbName)or DIE("Tabla no disponible");
$result=mysql_db_query("auth","select * from Personal1");
$number = MySQL_NUM_ROWS($result);
echo $number;
echo "<table width=400 align=center border=2 bgcolor='#F0FFFF' cellpadding=1 cellspacing=1 >";
echo "<td align=left>Legajo</td>";
echo "<td align=left>Nombre</td>";
echo "<td align=left>Interno</td>";
echo "<td align=left>Mail</td>";
$size = 1;
while($size <= $number)
{
$row=mysql_fetch_row($result);
echo "
<tr>
<td><input type=text size=3 name=leg".$size." value=$row[3]></td>
<td><input type=text size=25 name=nom".$size." value=$row[1]></td>
<td><input type=text size=8 name=int".$size." value=$row[4]></td>
<td><input type=text size=20 name=email".$size." value=$row[5]>
</tr>";
$size++;
}
echo"</table>";
mysql_close;
?>
<td colspan=5 ><br><input type=submit value='Modificar'>
<input type=hidden name=vuelta value='personaleditor.php'>
</FORM>
</BODY>
</HTML>
<?
$hostname = "localhost";
$username = "xxx";
$password = "xxx";
$dbName = "auth";
MySQL_CONNECT($hostname,$username,$password) or DIE("DATABASE NO RESPONDE");
mysql_select_db($dbName)or DIE("Tabla no disponible");
$result=mysql_db_query("auth","select * from Personal1");
$number = MySQL_NUM_ROWS($result);
$size = 1;
while($size <= $number)
{
$sSQL="Update Personal1 Set Nombre=$nom".$size.", Interno=$int".$size.", email1=$email".$size." where Legajo=$leg".$size."";
mysql_db_query("auth",$sSQL)or DIE("Error al grabar");
$size++;
}
mysql_close;