Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- mysql_connect("host", "uname", "pass")or die("cannot connect");
- mysql_select_db("dbbase")or die("cannot select DB");
- $items = count($_SESSION['cart']);
- $itemlist = (($items) ? 'IN (' . implode(',', $_SESSION['cart']) . ')' : '');
- echo '<table border="1">
- <tr>
- <td>Item Name</td>
- </tr>';
- if($items)
- {
- $query = mysql_query('SELECT * FROM tblProduct WHERE id '.$itemlist);
- while($row = mysql_fetch_array($query))
- {
- $name = $row['name'];
- $description = $row ['description'];
- $price = $row ['price'];
- $imagePath = $row ['imagePath'];
- echo '<tr>
- <td>' . $name . '</td>
- </tr>';
- }
- }
- echo '</table>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement