Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [jean] relational query using Globals - Help

Quote Reply
Re: [jean] relational query using Globals - Help In reply to
Hi,

I fixed in your server, this problem happens when you don't have a correct foreign key for your tables, the fk should be defined like this structure (in your def files):
'fk' => {
'remote_table' => {
'this_column' => 'remote_column'
},
and below is the code;
Code:
sub {
my $tags = shift;
my $id = $tags->{Category_ID};
my $table = $DB->table('catalog', 'catalog_sub_category');
$table->select_options ('ORDER BY Sub_Category');
my $sth = $table->select ([\"DISTINCT catalog.Sub_Category_ID", 'Sub_Category'],{ Category_ID => $id });
my $output;
my $num;
while (my $row = $sth->fetchrow_hashref) {
$num = $num + 1;
($output .= "<font face=\"verdana,arial,helvetica\" size=\"-2\" color=red>$num.</font> <font face=\"verdana,arial,helvetica\" size=\"-2\"><a href=db.cgi?&sid=$tags->{session_id}>$row->{Sub_Category}</a></font><br><br>\n");
}
return $output;
}

Cheers,
jean
Subject Author Views Date
Thread relational query using Globals - Help Bearwithme 9911 Nov 12, 2001, 1:31 PM
Thread Re: [Bearwithme] relational query using Globals - Help
Alex 9751 Nov 13, 2001, 11:06 AM
Thread Re: [Alex] relational query using Globals - Help
Bearwithme 9724 Nov 13, 2001, 11:56 AM
Post Post deleted by Bearwithme
Bearwithme 9664 Nov 14, 2001, 9:09 AM
Thread Re: [Bearwithme] relational query using Globals - Help
Alex 9659 Nov 16, 2001, 3:34 PM
Thread Re: [Alex] relational query using Globals - Help
Bearwithme 9618 Nov 16, 2001, 3:56 PM
Post Re: [Bearwithme] relational query using Globals - Help
Bearwithme 9654 Nov 18, 2001, 4:11 AM
Thread Re: [Bearwithme] relational query using Globals - Help
Bearwithme 9582 Nov 22, 2001, 9:48 PM
Thread Re: [Bearwithme] relational query using Globals - Help
jean 9547 Nov 23, 2001, 9:57 AM
Thread Re: [jean] relational query using Globals - Help
Bearwithme 9505 Nov 23, 2001, 12:06 PM
Thread Re: [Bearwithme] relational query using Globals - Help
jean 9574 Nov 23, 2001, 12:16 PM
Thread Re: [jean] relational query using Globals - Help
jean 9509 Nov 23, 2001, 6:20 PM
Thread Re: [jean] relational query using Globals - Help
Bearwithme 9547 Nov 23, 2001, 8:47 PM
Post Re: [Bearwithme] relational query using Globals - Help
Halito 9339 Mar 5, 2002, 8:13 AM
Post Re: [Alex] relational query using Globals - Help
Bearwithme 9681 Nov 14, 2001, 9:21 AM
Post Re: [Bearwithme] relational query using Globals - Help
Bearwithme 9693 Nov 14, 2001, 10:35 PM
Post Re: [Bearwithme] relational query using Globals - Help
Bearwithme 9634 Nov 16, 2001, 1:07 AM