Download presentation
Presentation is loading. Please wait.
Published byMerilyn Logan Modified over 9 years ago
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; } ?>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.