Open Message when clicked table field
Posted: Fri Nov 27, 2009 6:49 am
Hy everyone,
I have 1 table that represents the messages that 1 certain doctor have. What im trying to do is when the doctor click on 1 message of the table, the text on that message happears in the right side of the table.
Im going to post here the code i have for now....
Im opening ler_mensagens.php when the field is clicked, but i think i need is to run a script that would put the message on the right side of the table.
I hope u understand what i mean, and that u can help me on the best way i can have to do this.
I have 1 table that represents the messages that 1 certain doctor have. What im trying to do is when the doctor click on 1 message of the table, the text on that message happears in the right side of the table.
Im going to post here the code i have for now....
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[1]; ?></td>
<td><a href="ler_mensagens.php?id=<?php echo $dados['id']; ?>" target="_blank"><?php echo $dados[4]; ?></a></td>
<td>| <?php echo $dados[6]; ?></td>
<td>| <?php echo $dados[7]; ?></td>
</tr>
<?php } ?>
</table>
<?php
} else $nome = '';
?>I hope u understand what i mean, and that u can help me on the best way i can have to do this.