Click on line in the table, to open new message?
Posted: Wed Nov 25, 2009 6:43 am
hy everyone,
I have 1 table of messages that is create dinamicaly. What im trying to do now is when the user click on 1 line of the table("each line of the table represents 1 message"), the message open in a new window.
Im going to post my code here... i thing it helps always!
I have 1 table of messages that is create dinamicaly. What im trying to do now is when the user click on 1 line of the table("each line of the table represents 1 message"), the message open in a new window.
Im going to post my code here... i thing it helps always!
Code: Select all
<!----------------PESQUISA POR Medico---------->
<?php
if(isset($_POST['submit']))
{
$id_medico = strip_tags($_POST['id_medico']);
$exc = "SHOW TABLES"; /*VARIĆVEL RENOMEADA*/
$query = mysql_query("SELECT * FROM mensagens WHERE id_medico = '".mysql_real_escape_string($id_medico)."'");
?>
<div id="topic">
<b>Tabelas da base de dados</b>
</div>
<table id="content" border="2" bordercolor="#00CC00">
<tr>
<th>id_utilizador</th>
<th>mensagem</th>
<th>data</th>
<th>hora</th>
</tr>
<?php
while($dados = mysql_fetch_array($query)){
?>
<tr>
<td> <?php echo $dados[2]; ?></td>
<td>| <?php echo $dados[3]; ?></td>
<td>| <?php echo $dados[4]; ?></td>
<td>| <?php echo $dados[5]; ?></td>
</tr>
<?php } ?>
</table>
<?php
} else $nome = '';
?>