Jump to content

[SOLVED] Mysql into Link


idgeit

Recommended Posts

<?php
$handle = mysql_connect('xxx', 'xx', 'xxxx');
if($handle == false){
die("Could not connect to MySQL. Exiting.\r\n");
}

$db = mysql_select_db('xxxx');
if($db == false){
die("Could not select MySQL DB. Exiting.\r\n");
}
$query = "SELECT products.product_id, products.product_dis, products.product_price, products.product_title, products.product_pic FROM products WHERE products.product_id = ".$_GET['id'];
$result = mysql_query($query, $handle);
while($row = mysql_fetch_assoc($result)){

     $product_id = $row["product_id"];
     $product_dis = $row["product_dis"];
     $product_title = $row["product_title"];
     $product_price = $row["product_price"];
     $product_pic = $row["product_pic"];
}
mysql_close($handle);

?>
  <?php include('phpinclude/top.php'); ?><br>
<table width="74%" height="486" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="22%" rowspan="2" valign="top"><?php include('phpinclude/menu.php'); ?> </td>
    <td width="78%" height="333"><br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <table width="85%" height="48" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="55%" valign="top">
<table width="100%" height="119" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="36%" height="18" bgcolor="#CCCCCC"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Product
                  No.</strong></font></td>
                <td width="64%" bgcolor="#CCCCCC"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo ("$product_id");    ?></font></td>
              </tr>
              <tr bgcolor="#EAEAEA">
                <td height="18"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Title:</strong></font></td>
                <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo ("$product_title");    ?> </font></td>
              </tr>
              <tr>
                <td height="18" bgcolor="#CCCCCC"><p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Description:</strong></font></p>
                  <p> </p></td>
                <td valign="top" bgcolor="#CCCCCC"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><?php echo ("$product_dis");    ?></font></td>
              </tr>
              <tr bgcolor="#EAEAEA">
                <td height="18"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Price:</strong></font></td>
                <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">€<?php echo ("$product_price");    ?></font></td>
              </tr>
              <tr>
                <td bgcolor="#CCCCCC"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
                <td bgcolor="#CCCCCC"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
              </tr>
            </table></td>
          <td width="45%" valign="top"><img src= <?php echo $product_pic; ?> height="150" width="150"></td>
        </tr>
      </table> 
      <br>
 <a href="/addtocart.php?id=$product_id">Link</a>
  </tr>
  <tr>
    <td height="153"></td>
  </tr>
</table>
<br>
<?php include ('phpinclude/trailer.php'); ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.