Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

GT::SQL::Condition not structured correctly?

Quote Reply
GT::SQL::Condition not structured correctly?
Hi guys. I'm having a bit of a problem with a "count" I'm doing.

Code:
my $cond = GT::SQL::Condition->new('Message.msg_username','=',$USER->{user_username} =>, 'PMFoldersIDs.folder_id' => '=' => $folder_id);
$cond->bool('AND');

I've also tried it without bool()...

Basically, I need it to only;

Message.msg_username MUST EQUAL $USER->{user_username}
PMFoldersIDs.folder_id MUST EQUAL $folder_id (a number)

Can anyone give me a hand with this? I've tried the new structuring of;

'Field' => '=' => $value, 'Otherfield' => '=' => $value2

.. but that gives an incorrect count.

It seems to only be taking into account the "Message" table count, as its giving back 239, instead of 2 (which is what it should be).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread GT::SQL::Condition not structured correctly? Andy 2326 Jul 6, 2004, 8:28 AM
Thread Re: [Andy] GT::SQL::Condition not structured correctly?
afinlr 2247 Jul 6, 2004, 12:33 PM
Thread Re: [afinlr] GT::SQL::Condition not structured correctly?
Andy 2268 Jul 7, 2004, 1:02 AM
Thread Re: [Andy] GT::SQL::Condition not structured correctly?
afinlr 2239 Jul 7, 2004, 4:23 AM
Post Re: [afinlr] GT::SQL::Condition not structured correctly?
Andy 2240 Jul 7, 2004, 6:15 AM