Código:
Y mi archivo procesar.php contiene lo siguiente:<html> <head> </head> <body> <table border="1" width="100%"> <tr> <td width="101" align="center" bgcolor="#000000"><font color="#FFFFFF"> FECHA</font></td> <td width="81" align="center" bgcolor="#000000"><font color="#FFFFFF"> HORA</font></td> <td width="123" align="center" bgcolor="#000000"><font color="#FFFFFF"> PERSONA</font></td> <td width="90" align="center" bgcolor="#000000"><font color="#FFFFFF"> TIENDA</font></td> <td align="center" bgcolor="#000000"><font color="#FFFFFF">MENSAJE</font></td> <td width="55" align="center" bgcolor="#000000"><font color="#FFFFFF"></font></td> </tr> <?php $conexion = mysql_connect("server", "user", "pass"); mysql_select_db("tpvmessages", $conexion); $queEmp = "SELECT * FROM messages WHERE leido = 0 ORDER BY idMessage ASC"; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp> 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)){ echo "<tr>"; echo "<td scope=col>".$rowEmp['Fecha']."</td> \n "; echo "<td scope=col>".$rowEmp['hora']."</td> \n "; echo "<td scope=col>".$rowEmp['Persona']."</td> \n "; echo "<td scope=col>".$rowEmp['tienda']."</td> \n "; echo "<td scope=col>".$rowEmp['Texto']."</td> \n "; echo "<td><a href='procesar.php?item=".$rowEmp[idMessage]."'>Borrar</a></td> \n"; echo "</tr>"; } } ?> </table> </body> </html>
Código:
El problema que tengo creo que es con el procesar.php que no hace el update bien. La verdad que ya no se como seguir... seguramente sea una tontería pero ando perdidisimo en este momento.<? mysql_connect("server", "user", "pass"); isset($_GET['item']); $item = $_GET['item']; mysql_query ("UPDATE FROM messages WHERE idMessage = $item SET leido = 1"); header ("index.php") ?>
La intencion es que borre toda la fila de la tabla.