Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dsn = 'mysql:hosy=localhost;dbname=products';
- $username = 'root';
- $password = '';
- try{
- // connect to mysql
- $con = new PDO($dsn,$username,$password);
- $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch (Exception $ex) {
- echo 'Not Connected '.$ex->getMessage();
- }
- $query = $con->prepare("SELECT * FROM store LIMIT 9");
- $query->execute();
- $items = $query->fetchAll();
- foreach($items as $item) {
- echo '
- <div class="product">
- <div style="height: 7px;visibility: hidden;"></div>
- <h3>'.$item["product_name"].'</h3>
- <div class="inner">
- <div class="image">
- </div>
- </div>
- </div>'; }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement