classes and database advice

Hi,

i’m struggling a little with how to call data with classes from within my project and wondered if anyone had any tips please… basically i have a three tier database table structure:

db_header_table
db_item_table (links to header table)
db_sub_items (links to items table)

I’m trying to avoid creating a single query that contains joins on these tables as the db groans (i don’t maintain the db!), so i’d like to pass data from the header table into a function that creates a new class for the item and then pass data from the items to a function that creates a class for the subitems, and be able to retrieve data from each object created by the class. I’d like to keep my db query variables separate, but if i put the query to create new class within a function, i can’t retrieve data from the class.

thanks,

kjr

sorry but i am unclear of what you want to accomplish and the syntax you are using can you please explain again :smiley:

thanks for the reply, i guess i’m looking for the best approach of getting data from distinct classes:

a) in terms of how to access multiple fields from each class.
b) localisation of sql connection variables

I guess i’m just seeking advice on how i’d structure my db connections, php, sql and classes.

Sponsor our Newsletter | Privacy Policy | Terms of Service