Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. $id = $_POST['id'];
  2.  
  3.    
  4.     $query = sprintf("SELECT * FROM `mensagens` WHERE `id` = '". $id. "'");
  5.     $dados = mysql_query($query) or die(mysql_error());
  6.     $linha = mysql_fetch_assoc($dados);
  7.     $total = mysql_num_rows($dados);
  8.    
  9.     if($total > 0) {
  10.                       do {
  11.                      
  12.                       echo $linha['assunto'];
  13.                      
  14.                       }
  15.                      while($linha = mysql_fetch_assoc($dados));
  16.                       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement