Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Re: What I Will Need Links SQL to Do

Quote Reply
Re: What I Will Need Links SQL to Do In reply to
the beauty of Links SQL is making the database objects allow easy access to do anything with the database..

databases can be created to do anything.. in most of my links sql projects that people have paid me to do I make numerous tables for different levels of data.. searching multiple databases is much easier than modding nph-build.cgi though.. nph-build.cgi is the largest hassle in this.. i went about it this way.. another field in category db.. called it.. 'Database'.. database is either Hardware, Software or Accessories.. there is only one database for categories.. so that doesn't matter.. there are three databases for links.. for building category pages.. i checked which database to use by using the $category_r->{Database} scalar.. then i changed this line..

Code:
$get_links = $LINKDB->prepare (" SELECT * FROM Links WHERE CategoryID = ? ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
to..

Code:
$OUT{Database} = $category_r->{Database};
$get_links = $LINKDB->prepare (" SELECT * FROM $OUT{Database} WHERE CategoryID = ? ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
(and i obviously put that into the loop..)

then there are many occurences of these..

Code:
$tmp = $LINKDB->array_to_hash (${$links_r}[$i]);
so i assigned the object to the correct DB to $DB with ifelse statements..

and with all the hashrefs.. i put.. $tmp->{Database} = $OUT{Database}; so i could check in HTML_Templates.pm which template to use.. (simply by make the template.. "${$tags}{Database}_link.html"

ok.. that is category pages..

umm.. now what... detailed pages??

ok.. well.. i just made a loop.. ie.. foreach (@database) {

}..

so basically it goes through each of them getting each record..

i didn't do anything else.. too complicated..

Jerry Su
Subject Author Views Date
Thread What I Will Need Links SQL to Do OneDanShow 6591 Jul 22, 2000, 8:32 AM
Thread Re: What I Will Need Links SQL to Do
Stealth 6509 Jul 22, 2000, 11:54 AM
Thread Re: What I Will Need Links SQL to Do
OneDanShow 6402 Jul 28, 2000, 5:38 PM
Post Re: What I Will Need Links SQL to Do
pugdog 6387 Jul 29, 2000, 9:24 PM
Thread Re: What I Will Need Links SQL to Do
jsu 6384 Jul 29, 2000, 9:41 PM
Thread Re: What I Will Need Links SQL to Do
OneDanShow 6335 Aug 6, 2000, 5:57 PM
Post Re: What I Will Need Links SQL to Do
Stealth 6339 Aug 6, 2000, 6:20 PM
Thread Re: What I Will Need Links SQL to Do
OneDanShow 6310 Aug 10, 2000, 2:11 PM
Post Re: What I Will Need Links SQL to Do
Stealth 6295 Aug 10, 2000, 9:02 PM