Prev | Current Page 213 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

For more details, you can always refer to the official documentation
at http://dev.mysql.com/doc/refman/5.1/en/select.html.
Writing the New Database Stored Procedures
Now that you are familiar with how to query the database, you can implement the data tier
stored procedures, which will return data from the database. First, you??™ll implement the MySQL
stored procedures that retrieve department and category information:
??? catalog_get_department_details
??? catalog_get_categories_list
??? catalog_get_category_details
Afterward, you??™ll write the stored procedures that deal with products. Only four stored
procedures ask for products, but you??™ll also implement three helper functions (catalog_count_
products_in_category, catalog_count_products_on_department, and catalog_count_products_
on_catalog) to assist in implementing the paging functionality. The complete list of stored
procedures you need to implement follows:
CHAPTER 5 ?–  CREATING THE PRODUCT CATALOG: PART 2 129
??? catalog_count_products_in_category
??? catalog_get_products_in_category
??? catalog_count_products_on_department
??? catalog_get_products_on_department
??? catalog_count_products_on_catalog
??? catalog_get_products_on_catalog
??? catalog_get_product_details
??? catalog_get_product_locations
Notice that we have named our stored procedures in such a way that the name tells you
what the stored procedure does.


Pages:
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225