Author Topic: How Many Records by 'X' in DB1 are in DB2??  (Read 1433 times)

0 Members and 1 Guest are viewing this topic.

Offline smc

  • Full Member
  • ***
  • Posts: 45
    • EternityWhere.com
How Many Records by 'X' in DB1 are in DB2??
« on: September 13, 2007, 03:00:53 PM »
Here's the scenario.

I have a DB called "speaker" with over 100 speakers.  I have a second DB called "audio" which has MP3 files by all these speakers.  I wanted to display the "speaker" list and beside each speaker name display the number of MP3s they have in the "audio" DB.  I did this again by javascript by inserting the following into the list template beside the speaker name.

<script language="JavaScript" type="text/javascript" src="http://www.colerainefpc.org/cgi-bin/audio/audio.cgi?speaker_surname=[[surname]]&speaker_firstname=[[firstname]]&template=speaker_matches_js">  </script>

This is essentially a query on the "audio" DB by speaker name.  The template for this bit looks like this;

document.write('<font face="Arial, Helvetica, sans-serif" size="1"> &#149; <<#_matches>></font>');
<template>
</template>

You can see it in action at;

http://www.colerainefpc.org/sermons.shtml

AND YOU WILL SEE THE PROBLEM!   :(

As there are over 100 speakers the page is VERY slow to load.  It does achieve the desired effect but is just very slow.

This may be a tip useful to someone, but for a large DB might be better avoided!

Offline foxmulder

  • Newbie
  • *
  • Posts: 17
Re: How Many Records by 'X' in DB1 are in DB2??
« Reply #1 on: October 28, 2007, 11:04:36 AM »
Hello SMC  ;D

You may have just helped me figure out a solution to something I was looking for.

Sorry to hear about your page load. In return I send you this back like Pete Sampras
hitting a backhand winner down the line in return. Hope this one is inside the line
for you purposes ans is actually a Winner!

http://www.ezscriptingforums.com/forum/index.php?topic=576.0

I'll update you if your solution works for me.  ;D

Fox Mulder

The truth is out there.

Offline smc

  • Full Member
  • ***
  • Posts: 45
    • EternityWhere.com
Re: How Many Records by 'X' in DB1 are in DB2??
« Reply #2 on: November 01, 2007, 03:30:13 AM »
Hi Foxmulder

Many thanks for the reply; I will certainly try it out.  Hopefully it will be 30-15 to my slow page load!