Presentation is loading. Please wait.

Presentation is loading. Please wait.

CpSc 3220 HTML, PHP, MySQL Exercises Chapter 19 Murach’s PHP and MySQL.

Similar presentations


Presentation on theme: "CpSc 3220 HTML, PHP, MySQL Exercises Chapter 19 Murach’s PHP and MySQL."— Presentation transcript:

1 CpSc 3220 HTML, PHP, MySQL Exercises Chapter 19 Murach’s PHP and MySQL

2 Murach's PHP and MySQL, C5© 2010, Mike Murach & Associates, Inc. Slide 2

3 Murach's PHP and MySQL, C5© 2010, Mike Murach & Associates, Inc. Slide 3

4 c:/xampp/htdocs/ex_starts/ch19_ex1 Murach's PHP and MySQL, C19© 2010, Mike Murach & Associates, Inc. Slide 4

5 index.php <?php require('util/main.php'); require('model/database.php'); require('model/product_db.php'); // Select some products $category_id = 2; // Get the products $products = get_products_by_category($category_id); //Delete a product $name = 'Fender Telecaster'; // Delete the product and display an appropriate message $delete_message = "No rows were deleted."; // Insert a product $category_id = 1; $code = 'tele'; $name = 'Fender Telecaster'; $description = 'NA'; $price = '949.99'; // Insert the data and Display an appropriate message $insert_message = "No rows were inserted."; include 'home.php'; ?>

6 database.php PDO::ERRMODE_EXCEPTION); try { $db = new PDO($dsn, $username, $password, $options); } catch (PDOException $e) { $error_message = $e->getMessage(); include 'errors/db_error_connect.php'; exit; } function display_db_error($error_message) { global $app_path; include 'errors/db_error.php'; exit; } ?>


Download ppt "CpSc 3220 HTML, PHP, MySQL Exercises Chapter 19 Murach’s PHP and MySQL."

Similar presentations


Ads by Google