Jump to content
Larry Ullman's Book Forums

Scott Gardner

Members
  • Posts

    3
  • Joined

  • Last visited

Scott Gardner's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Following the book on up to page 313 and changing the code in main.php to match the code at the top of page 314 does not work. The menu is presented vertically.
  2. Thanks for your response and the welcome, HartleySan! Storing images/blobs in the database is justifiable in certain use cases, and under certain conditions, many of which are noted on the SO you linked to. One software solution I work with now is facing serious challenges associated with multi-location based usage because they architecturally decided to store all images and files in an encrypted disk image. As computers become faster, and db engines are actively developed to take advantage of these advancements, it is conceivable that we will eventually just store everything in a database (or equivalent data persistence layer). And in fact, in Core Data (iOS/OS X ORM), it is encouraged to just construct the model as containing the blob and enable the OS to decide whether to store the file externally or in the db. I believe it's true that excluding a column in a select will mean that data does not get fetched. Although, it's also possible that some db engines or middleware may be doing pre-fetching or other such routines, and of course select *s will just grab everything (take your pick in calling it programmer efficiency or laziness). So for the minimal additional effort, when storing blobs in a db, I would isolate them even when it's a one-to-one relation.
  3. (I had to laugh after reading back the title I entered for this post.) On page 104 you wrote, "One-to-one relationships in databases aren’t that common as one-to-one relations can alternatively be combined into a single table." I'm coming (back) to PHP from iOS, and in iOS, specifically in Core Data, it is common to use one-to-one relationships to optimize performance. For example, when storing an image or other blob in the database, storing the blob in a separate table related one-to-one prevents the blobs from being loaded until specifically fetched. In this scenario, it might make sense to store a thumbnail of an image in the main table and the full size image in the separate table. Wouldn't this same optimization technique apply here?
×
×
  • Create New...