SHARE
TWEET

Untitled

a guest Nov 3rd, 2011 1,426 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.         //Conexão com Banco de Dados
  3.         include('conexao.php');
  4.        
  5.         //resgata o ID da URL
  6.         $id = (int)$_GET['id'];
  7.        
  8.         //Seleciona o produto filtrado pelo id
  9.         $sql = "SELECT * FROM produtos WHERE id = '$id'";
  10.        
  11.         //Executa o SQL
  12.         $query=  mysql_query($sql);
  13.        
  14.         //Resgata os valores da tabela
  15.         $row = mysql_fetch_assoc($query);
  16. ?>
  17.  
  18. <!DOCTYPE HTML>
  19. <html lang="en-US">
  20. <head>
  21.         <meta charset="UTF-8">
  22.         <title></title>
  23. </head>
  24. <body>
  25.         <h1>Produto : <?php echo $row['produto']?></h1>
  26.         <a href="carrinho.php?acao=add&id=<?php echo $row['id']?>">Adicionar no Carrinho</a>
  27. </body>
  28. </html>
  29.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top