Prev | Current Page 206 | Next

Emilian Balanescu and Cristian Darie

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

The
arrows between two tables point toward the table in the one part of the relationship.
Querying the New Data
Now, you have a database with a wealth of information just waiting to be read by somebody.
However, the new elements bring with them a set of new things you need to learn.
For this chapter, the data tier logic is a little bit more complicated than in the previous
chapter, because it must answer to queries like ???give me the second page of products from the
Cartoons category??? or ???give me the products on promotion for department X.??? Before moving
on to writing the stored procedures that implement this logic, let??™s first cover the theory about
??? Retrieving short product descriptions
??? Joining data tables
??? Implementing paging
Let??™s deal with these tasks one by one.
Getting Short Descriptions
In the product lists that your visitor sees while browsing the catalog, we won??™t display full product
descriptions, only a portion of them. In TShirtShop, we??™ll display the first 150 characters of
every product description, after which, if the description has a greater length, we concatenate
(append) ellipses (. . .) to the end of the description. Of course, you can decide if you would like
more or less of the description to display by simply changing this length (150 in our design) to
whatever number you choose; be sure to verify that this displays well by previewing your changes
in your browser of choice.


Pages:
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
gromada CSS Ninja remont warszawa traktorki ogrodowe kolej transsyberyjska