Page 1 of 1

Displaying result count for multiple profiles

Posted: Thu Sep 22, 2005 2:13 pm
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?

Displaying result count for multiple profiles

Posted: Thu Sep 22, 2005 2:13 pm
by KMandalia
BTW, there is an index on Title/Body/Url on each of the a,b, c profiles.

Displaying result count for multiple profiles

Posted: Thu Sep 22, 2005 3:52 pm
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.