4
wtravel:
Suppose I have these tables:
CREATE TABLE table1 (
id1 smallint(5) unsigned NOT NULL auto_increment,
data1 varchar(255) NOT NULL default '',
PRIMARY KEY (id)
);
CREATE TABLE table2 (
id2 smallint(5) unsigned NOT NULL auto_increment,
data2 DATE NOT NULL default '0000-00-00',
PRIMARY KEY (id)
);
CREATE TABLE link (
id1 smallint(5) unsigned NOT NULL default '0',
id2 smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (id1, id2)
);
The third table links the first two.
A typical query might be:
SELECT * FROM link AS ln
LEFT JOIN table1 AS t1 ON t1.id1 = ln.id1
LEFT JOIN table2 AS t2 ON t2.id2 = ln.id2
WHERE data1 LIKE 'foo%' AND data2 > '2006-01-15';
How would I implement this using the XoopsObject class?
-----
McNaz:
I glanced through lernel/member.php, but couldn't find any good examples. I'll try again.