DB_DataObject linking tables

From: Date: Sat, 11 Dec 2004 21:52:24 +0000
Subject: DB_DataObject linking tables
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16181@lists.php.net to get a copy of this message
I have been looking at the links.ini examples and am wondering if there is a way that I could use it with my setup. Right now, I have a database that has 2 sets of paired columns. One of columns in the pair is the id in a database that tells the second column where its data is. Example: table: inventory columns id,categoryname,itemid
row     1,food,10
row     2,food,9
row     3,luggage,15
table: food colums id,item
row    9,apple
row    10,banana
table: luggage columns id,item,size
row     15,briefcase,large
In my example, I have the main table inventory that holds all the items in my store. The first column, cateregoryname, is the name of different tables that hold specific information (since food and luggage have different attributes). The itemid is the id of a specific item inside of the category table. Right now, I have to look up the inventory table for a certain item, get the category that it is in and then look up in the category the itemid that I found in inventory. Do you think a links.ini file could do it? If not, do you think I could do it with the getLink() command? An example would be real helpful. I have looked at the documentation but still don't know how I could get at least the getLink() command to work. Thanks, Trevan

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.general (#16181) next »