Prev | Current Page 178 | Next

Emilian Balanescu and Cristian Darie

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

Also, make sure to check the book??™s errata page, which we??™ll keep updated with solutions to potential
problems you may run into.
How It Works: The departments_list Smarty Template
If the page worked as expected from the start, you??™re certainly one lucky programmer! Most of the time, errors
happen because of typos, so watch out for them! Database access problems are also common, so make sure you
correctly configured the tshirtshop database and the tshirtshopadmin user, as shown in Chapter 3. In any
case, we??™re lucky to have a good error-reporting mechanism, which shows a detailed error report if something goes
wrong. Figure 4-14 shows the error message I received when mistyping the database password in config.php.
The error message shows up in the box that generated it (to be able to read the message, you need to select it in
the box it was generated, and paste it in another document).
Figure 4-14. The error-handling code you??™ve written in Chapter 2 is helpful for debugging.
If everything goes right, however, you??™ll get the neat page containing a list of departments generated using
a Smarty template. Each department name in the list is a link to the department??™s page, which, in fact, is a link to
CHAPTER 4 ?–  CREATING THE PRODUCT CATALOG: PART 1 105
the index.php page with a DepartmentId parameter in the query string that specifies which department was
selected.


Pages:
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
perfumy fm Anteny satelitarne apartamenty przy plaży online loan for bad credit rekuperatory