Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $conecta = mysql_connect("localhost","root","") or die (mysql_error());
- $db = mysql_select_db("va") or die (mysql_error());
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>vitrine de produtos</title>
- <style type="text/css">
- #conteudo{
- width:900px;
- background:#333;
- padding:10px;
- margin:50px auto;
- }
- </style>
- </head>
- <body>
- <div id="conteudo">
- <table cellpadding="8" cellspacing="10" border="0" width="100%">
- <tr>
- <?php
- $loop = 3;
- $select = "SELECT * FROM produtos";
- $qr = mysql_query($select);
- $i = 1;
- while($ln = mysql_fetch_array($qr)){
- if($i < $loop){
- echo '
- <td valign="top" align="center" bgcolor="#f4f4f4">
- <img src="'.$ln['caminho'].$ln['foto'].'" width="200" alt="" />
- </td>
- ';
- }elseif($i = $loop){
- echo '
- <td valign="top" align="center" bgcolor="#f4f4f4">
- <img src="'.$ln['caminho'].$ln['foto'].'" width="200" alt="" />
- </td>
- </tr>
- <tr>
- ';
- $i = 0;
- }
- $i++;
- }
- ?>
- </tr>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment