mi codigo es este :
Código PHP:
<?php
$host="localhost"; // Host name
$username="prueba"; // Mysql username
$password="prueba"; // Mysql password
$db_name="prueba"; // Database name
$tbl_name="agenda_act"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$autorizacion=$_POST['autorizacion'];
$sql="SELECT *, agenda_act.ID as id1
FROM agenda, agenda_act,pacientes
WHERE agenda.id_agen=agenda_act.id_agen and pacientes.documento=agenda.paciente and autorizacion='$autorizacion' and realizada='0'
";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?>
<head>
<title>REPROGRAMACION DE SERVICIOS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
}
.Estilo1 {color: #FF6600}
.style1 { color: #0000FF;
font-weight: bold;
}
.style2 { color: #006600;
font-size: 18px;
}
.style9 {font-family: Arial, Helvetica, sans-serif}
body {
background-image: url(../imagenes/fondo.jpg);
}
-->
</style></head>
<p> </p>
<table width="794" height="379" border="0" align="center">
<tr>
<td height="84" colspan="2" align="left" valign="top"><div align="right"><img src="http://www.forosdelweb.com/f18/imagenes/logo_fon1.png" width="523" height="143" /></div></td>
<td width="1" height="84"> </td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td width="1079" align="center" valign="middle"> </td>
<td> </td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="center" valign="middle"><div align="right"><a href="<?php echo $logoutAction ?>">Desconectar</a></div></td>
<td> </td>
</tr>
<tr>
<td width="2" align="left" valign="top"> </td>
<td align="center" valign="top"><table width="400" height="293" border="1" align="center" cellpadding="0" cellspacing="0" id="borra">
<tr>
<td height="291"><form name="form1" method="post" action="">
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" id="tabla_paises">
<tr bgcolor="#FFFFE2">
<td align="center"><strong></strong></td>
<td align="center"><strong>AUTORIZACION</strong></td>
<td align="center"><strong>NOMBRE DEL PROFESIONAL </strong></td>
<td align="center"><strong>PACIENTE</strong></td>
<td align="center"><strong>FECHA PROGRAMADA</strong></td>
<td align="center"><strong>ACTIVIDAD</strong></td>
<td align="center"><strong>CANTIDAD ACTIVIDADES</strong></td>
<td align="center"><strong>NUEVA FECHA PROGRAMADA </strong></td>
<td align="center"><strong>NUEVO PROFESIONAL</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id1']; ?>" />
<? echo $rows['id1']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['AUTORIZACION']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['PROFESIONAL']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['PRIM_APE']; ?> <? echo $rows['SEG_APE']; ?> <? echo $rows['PRIM_NOM']; ?> <? echo $rows['SEG_NOM']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['FECH_ACT']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['ACTIVIDAD']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['CANT_ACT']; ?></td>
<td bgcolor="#FFFFFF"><input name="fech_act[]" type="text" onkeyup="mascara(this,'/',patron,true)" maxlength="10"id="fech_act[]" value="" /></td>
<td bgcolor="#FFFFFF"><select name="prof[]">
<option value="0">ELEGIR</option>
<? $result1=mysql_query("select * from profesionales order by PROFESIONAL asc");
while($row2 = mysql_fetch_array($result1))
{
echo "<option value='$row2[PROFESIONAL]'>$row2[PROFESIONAL]</option>";
}
?>
</select></td>
</tr>
<?php
}
?>
<tr>
<td colspan="9" align="center" bgcolor="#FFFFFF"><strong>TOTAL REGISTROS <?php echo $count;?>
<input name="us_rea" type="hidden" id="us_rea" value="<?php echo $_SESSION['MM_Username'];?>" />
</strong></td>
</tr>
<tr>
<td colspan="9" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="ACTUALIZAR" /></td>
</tr>
<?
$us_modifica=$_SESSION['MM_Username'];
$fech_modifica=date("Y/m/d H:i:s");
for ($indice=0; $indice<count($_POST['checkbox']); $indice++){
echo $_POST['checkbox'][$indice]."<br>";
echo $_POST['fech_act'][$indice]."<br>";
echo $_POST['prof'][$indice]."<br>";
// actualizas tu registro ..
$sql1="UPDATE agenda_act SET FECH_ACT='".$_POST['fech_act'][$indice]."', PROFESIONAL='".$_POST['prof'][$indice]."', us_modifica= '".$us_modifica."',fech_modifica='".$fech_modifica."' WHERE ID='".$_POST['checkbox'][$indice]."'";
mysql_query($sql1) or die (mysql_error());
}
$result1 = mysql_query($sql1);
if($result1){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=cambio_prof.php\">";
}
?>
</table>
</form></td>
</tr>
</table>
<p class="style1 style2 style9 Estilo1"> </p></td>
</tr>
<tr> </tr>
<tr> </tr>
</table>
<p align="center"> </p>
<p> </p>
<p> </p>