1
eacastel
Relational database question
  • 2005/6/9 9:59

  • eacastel

  • Just popping in

  • Posts: 2

  • Since: 2005/6/9 9


I am using the AMS module and want to be able to associate 10 or more different categories with another 50.

Lets say then I can look group articles by catA and sub B or cat B and sub A

I have hotels and restaurants in all countries. Want to display by country all hotels and restaurants and vice versa with hotels all countries and restaurants all countries...

How can I approach this? My idea is another table duplicating categories..? How do I program it into the module?

Any brave souls?

2
eacastel
Re: Relational database question
  • 2005/6/10 8:55

  • eacastel

  • Just popping in

  • Posts: 2

  • Since: 2005/6/9 9


Ok, I guess I over did it with the question I even got confused after I read it...

Basically I have hotels, restaurants and bars for several countries. I would like to group results by venue (hotels, etc..) and by country as well.

Now, that was easier... Please help. At least tell me If my case is lost here in the forum.

E.

3
Herko
Re: Relational database question
  • 2005/6/10 9:27

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


The wf_links module (found at www.wf-projects.com) has multi-category features, which means you can add a link to more the one category. That may be the closest thing you want, as there is no global category system for XOOPS -yet (working on it for XOOPS 2.4, most likely).

Herko

4
fo-fo
Re: Relational database question
  • 2005/6/10 10:58

  • fo-fo

  • Just popping in

  • Posts: 34

  • Since: 2005/4/13


I don't use the AMS module, but it's relatively easy to with an sql query.
let's say a database table 'joints' with 'country', 'hotel', 'restaurant' rows.
you want to look up all hotels in Brazil, you do:

...
echo "<tr><th>BRAZIL</th></tr>";

$result = mysql_query("SELECT hotel FROM ".$xoopsDB->prefix("joints")." WHERE country='BRAZIL'");
while($row = mysql_fetch_array($result))
{

$hotel = mysql_result($result, "hotel");

echo "$hotel";
}
...

you want to look up all hotels in all countries, you do:

...

$result = mysql_query("SELECT * FROM ".$xoopsDB->prefix("joints").");
while($row = mysql_fetch_array($result))
{
$country = mysql_result($result, "country");
$hotel = mysql_result($result, "hotel");

echo "$country";
echo "$hotel";
}
...

this code seq may have bugs in it.

5
phppp
Re: Relational database question
  • 2005/6/10 12:10

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


the "article" module, which was planned as "wfsection 3", has the cross-category ability

Its public test version will be released once XOOPS 2.2 is done
right now you can see a very brief demo at
https://xoops.org.cn/modules/article/

Login

Who's Online

135 user(s) are online (84 user(s) are browsing Support Forums)


Members: 0


Guests: 135


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits