<?php function add_product($category_id, $code, $name, $price) { global $db; $query = 'INSERT INTO products (categoryID, productCode, productName, listPrice) VALUES (:category_id, :code, :name, :price)'; $statement = $db->prepare($query); $statement->bindValue(':category_id', $category_id); $statement->bindValue(':code', $code); $statement->bindValue(':name', $name); $statement->bindValue(':price', $price); $statement->execute(); $statement->closeCursor(); } ?>