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

Re: [RedRum] Category Menu Everywhere

Quote Reply
Re: [RedRum] Category Menu Everywhere In reply to
I'm not sure what you mean...

$DB is the Links global to the MySQL DBI database handle object.

You use it to connect and get a table handle:

$db = $DB->table ('table_name')

$db is now the table pointer, and used to do selects, queries, adds, etc to a specific table in the database $DB

Once you get your $db table handle, you can:

$db->select_options ()

then you need to do a

$sth = $db->select

to execute the select, and put the results into a statement handle. the $db is a table object, not a statement handle.

To see if there were any hits, you would do:

$db->hits (returns the total hits on the last query without any Limit statement restrictions ie: total database matches)

Then, you could start iterating through the results, using the STATEMENT HANDLE :

while (my $row = $sth->fetchrow_hashref) {
..... stuff ......
}

Where $row is a reference to the returned hash of values (same as $rec in the other scripts)

You need to do the

if ($db->hits) {
while (my $row = $sth->fetchrow_hashref){
.... stuff ....
}
}

Construct, in order to avoid undefined value errors trying to use a null $sth.

Or did I miss the point of your post??












PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Subject Author Views Date
Thread Category Menu Everywhere reenee 17941 Dec 31, 2001, 4:43 AM
Thread Re: [reenee] Category Menu Everywhere
pugdog 17557 Dec 31, 2001, 7:06 AM
Thread Re: [pugdog] Category Menu Everywhere
Paul 17447 Dec 31, 2001, 8:48 AM
Thread Re: [RedRum] Category Menu Everywhere
pugdog 17457 Dec 31, 2001, 9:54 AM
Thread Re: [pugdog] Category Menu Everywhere
Paul 17953 Dec 31, 2001, 10:01 AM
Post Re: [RedRum] Category Menu Everywhere
reenee 17328 Dec 31, 2001, 10:51 AM
Thread Re: [reenee] Category Menu Everywhere
Alex 17396 Dec 31, 2001, 11:09 AM
Thread Re: [Alex] Category Menu Everywhere
reenee 17377 Dec 31, 2001, 11:19 AM
Thread Re: [reenee] Category Menu Everywhere
reenee 17308 Dec 31, 2001, 11:57 AM
Thread Re: [reenee] Category Menu Everywhere
pugdog 17455 Dec 31, 2001, 12:04 PM
Thread Re: [pugdog] Category Menu Everywhere
Alex 17468 Dec 31, 2001, 12:05 PM
Thread Re: [Alex] Category Menu Everywhere
Paul 17425 Dec 31, 2001, 12:07 PM
Thread Re: [RedRum] Category Menu Everywhere
reenee 17333 Dec 31, 2001, 1:11 PM
Thread Re: [reenee] Category Menu Everywhere
Alex 17333 Dec 31, 2001, 1:44 PM
Thread Re: [Alex] Category Menu Everywhere
reenee 17389 Dec 31, 2001, 2:28 PM
Thread Re: [reenee] Category Menu Everywhere
reenee 17309 Dec 31, 2001, 3:39 PM
Thread Re: [reenee] Category Menu Everywhere
Alex 17286 Dec 31, 2001, 3:45 PM
Thread Re: [Alex] Category Menu Everywhere
reenee 17301 Jan 1, 2002, 6:58 PM
Thread Re: [reenee] Category Menu Everywhere
Alex 17271 Jan 2, 2002, 8:49 AM
Thread Re: [Alex] Category Menu Everywhere
macbethgr 17202 Apr 18, 2002, 4:53 PM
Thread Re: [macbethgr] Category Menu Everywhere
macbethgr 17135 Apr 19, 2002, 7:47 AM
Thread Re: [macbethgr] Category Menu Everywhere
pugdog 17021 Apr 19, 2002, 12:04 PM
Thread Re: [pugdog] Category Menu Everywhere
Nosmada 16737 Jul 24, 2003, 6:29 PM
Thread Re: [Nosmada] Category Menu Everywhere
ryel01 16602 Mar 14, 2004, 2:07 AM
Thread Re: [ryel01] Category Menu Everywhere
Mark2 16215 Feb 15, 2006, 9:27 AM
Thread Re: [Mark2] Category Menu Everywhere
afinlr 5268 Feb 16, 2006, 10:03 AM
Thread Re: [afinlr] Category Menu Everywhere
Mark2 5198 Feb 17, 2006, 8:10 AM
Thread Re: [Mark2] Category Menu Everywhere
afinlr 5129 Feb 17, 2006, 10:44 AM
Post Re: [afinlr] Category Menu Everywhere
Mark2 5096 Feb 17, 2006, 1:51 PM
Thread Re: [Mark2] Category Menu Everywhere
HopeForYou 4978 Jun 1, 2009, 7:57 PM
Post Re: [HopeForYou] Category Menu Everywhere
Andy 4930 Jun 1, 2009, 11:51 PM