Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  $con =mysql_connect('localhost', 'root');
  3.  if(!con)
  4.  {
  5.  die('Could not connect: ' . mysql_error());
  6.  }
  7.  mysql_Select_db("coupons", $con);
  8.  $manufacturer = $POST['mfg'];
  9.  $result = mysql_query("SELECT * FROM `coupondata` WHERE `Manufacturer` = '".$manufacturer."'");
  10.  echo"  
  11.    <html>
  12.      <body>
  13.        <table border='1'>
  14.          <tr>
  15.            <th>Manufacturer</th>
  16.            <th>Brand</th>
  17.            <th>Variety</th>
  18.            <th>Size</th>
  19.            <th>Unit</th>
  20.            <th>Pkg</th>
  21.            <th>Discount Amt.</th>
  22.            <th>Exp. Date</th>
  23.          </tr>
  24.  ";
  25.          while ($row = mysql_fetch_array($result))
  26.          {
  27.          echo"
  28.            <tr>
  29.              <td>". $row['Manufacturer'] ."</td>
  30.              <td>". $row['Brand'] ."</td>
  31.              <td>". $row['Variety'] ."</td>
  32.              <td>". $row['Size'] ."</td>
  33.              <td>". $row['Unit'] ."</td>
  34.              <td>". $row['Pkg'] ."</td>
  35.              <td>". $row['DiscAmt'] ."</td>
  36.              <td>". $row['ExpDate'] ."</td>
  37.            </tr>
  38.            ";
  39.          }
  40.          echo "
  41.        </table>
  42.      </body>
  43.    </html>
  44.          ";
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement