Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $row['car_name','car_fuel','car_engineSize','car_color'].' '.$row['car_ID'];
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <?php
- include 'connect.php';
- $stmt = $DB_con->prepare('SELECT car_name,car_fuel,car_engineSize,car_color FROM motor_vehicles ORDER BY car_ID DESC');
- $stmt->execute();
- if($stmt->rowCount() > 0)
- {
- echo '<ol>';
- while($row=$stmt->fetch(PDO::FETCH_ASSOC))
- {
- echo '<li>';
- echo $row['car_name','car_fuel','car_engineSize','car_color'].' '.$row['car_ID'];
- echo '</li>';
- }
- echo '</ol>';
- }
- ?>
- </body>
- </html>
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- $DB_HOST = 'localhost';
- $DB_USER = 'root';
- $DB_PASS = '';
- $DB_NAME = 'motor_vehicles';
- try {
- $DB_con = new PDO("mysql:host={$DB_HOST};dbname={$DB_NAME}", $DB_USER, $DB_PASS);
- $DB_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch (PDOException $e) {
- echo $e->getMessage();
- }
Add Comment
Please, Sign In to add comment