Displaying result count for multiple profiles

Post Reply
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

Displaying result count for multiple profiles

Post by KMandalia »

<$ProfileNameList="a" "b" "c">
<$ProfileValueList="x" "y" "z">
<loop $ProfileNameList $ProfileValueList>
<if $pr eq $ProfileNameList>
<b>$ProfileValueList</b>
<else>
<if $query ne "">
<SQL "select String from options where Profile=$ProfileNameList and Name='SS_db'"></sql>
<$mydb=$String>
<sql db=$mydb "select count(*) resultcount from html where Title\Body\Url likep $query"></sql>
</if>
<a href="$url?pr=$ProfileNameList&query=$query">$ProfileValueList</a> <if $query ne "">($resultcount Results)</if>
</if>
<if $ProfileNameList eq c>
<br>
<else>
<if $ProfileNameList neq c>
&nbsp;|&nbsp;
</if>
</if>
</loop>

what I want when i select profile a is

x | y (xxx results) | z (xxxx results) where x has xx results.

Instead, I am getting

x | y (xx results) | z (xx results) where xx is the x's no. of returned results.

What I am I doing wrong?
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

Displaying result count for multiple profiles

Post by KMandalia »

BTW, there is an index on Title/Body/Url on each of the a,b, c profiles.
KMandalia
Posts: 301
Joined: Fri Jul 09, 2004 3:50 pm

Displaying result count for multiple profiles

Post by KMandalia »

Never mind.

I thought in the search profile if no database is specified, it goes to texis/testdb. But it didn't.

Just did db=$controldb in the first sql statement that retrieves db path from profilename ,and it worked.
Post Reply