views:

86

answers:

0

Hi, my questions pertain to class objects defined for mysql/php interface:

Which of the following method is best from a design point and why (relative advantages/disadvantages to each other):

  1. To use a single class like ezSQL towards abstracting the mysql/php interface?
  2. To use a combination of a DB Connection Class and a Results Class?

Say, I want to build a search engine, where I would have to add links, attach a picture to each result, provide a link to edit that entry etc., should I use single class like ezSQL or a combo of DB Class and Results Class?

Also, whether the Results Class should be defined to represent an object covering the entire resultset or an object representing a single result from the entire resultset? Would there be any significant performance difference between the two for a database of 2 million entries and concurrent 500 queries?

Another related question:

3) For option 2 above, should the result loop be placed within a function in the Results Class to give all the results or the result loop should be outside the Class?