appeared_count}){/if}
        {if $question.question_appeared_count eq 0}
      <a id ="{$question.question_id}" href="#" class="c-icn c-remove delete_question"  title="Delete question"> Delete</a>{/if}
        {/if}

    </td>

    <td class="question" align="center" valign="top">
        {if $question.percentage!=''}{$question.percentage}{/if}
        {assign var=counter value=$counter+1}
    </td>
  </tr>
      {/foreach}               
    {/if}
  {/foreach}
{else}
  <tr>
    <td colspan="2" align="center"><b>No Questions Available</b></td>
  </tr>
{/if}
</table>

Thanks for the spending some of your valuable time in understanding my issue.

A:

I believe the bottleneck is on the looping over SQL queries. There is a standard way to rank search results on MySQL. You can simply implement full-text search.
First, you need to create a table like search_results:
SQL:
CREATE TABLE `search_results` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `result_title` varchar(128) CHARACTER SET utf8 NOT NULL,
  `result_content` text CHARACTER SET utf8 NOT NULL,
  `result_short_description` text CHARACTER SET utf8,
  `result_uri` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `result_resource_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `result_title` (`result_title`,`result_content`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

You have to insert all relevant data from the table of questions (including questions, subjects, answers, and whatever you want to search through them) into result_title and result_content here, (also update this table whenever it needs to be updated). There is also backtrack pointer to the original record
appeared_count}){/if } 
         { if $ question.question_appeared_count eq 0 } 
       < a i d = " { $ question.question_id } " href= " # " class="c - icn c - remove delete_question "   title="Delete question " > Delete</a>{/if } 
         { /if } 

     < /td > 

     < td class="question " align="center " valign="top " > 
         { if $ question.percentage!=''}{$question.percentage}{/if } 
         { assign var = counter value=$counter+1 } 
     < /td > 
   < /tr > 
       { /foreach }               
     { /if } 
   { /foreach } 
 { else } 
   < tr > 
     < td colspan="2 " align="center"><b > No Questions Available</b></td > 
   < /tr > 
 { /if } 
 < /table > 

 Thanks for the outgo some of your valuable meter in understanding my issue. 

 A: 

 I think the bottleneck is on the iteration over SQL queries. There is a standard room to rate search results on MySQL. You can simply implement full - text search. 
 foremost, you need to create a table like search_results: 
 SQL: 
 CREATE mesa 'search_results '(
   'i d 'int(10) unsigned NOT NULL AUTO_INCREMENT, 
   'result_title 'varchar(128) CHARACTER SET utf8 NOT NULL, 
   'result_content 'text CHARACTER SET utf8 NOT NULL, 
   'result_short_description 'text CHARACTER SET utf8, 
   'result_uri 'varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT", 
   'result_resource_id 'int(10) unsigned DEFAULT NULL, 
   PRIMARY KEY (` i d `), 
   FULLTEXT KEY 'result_title '(` result_title`,`result_content `) 
) ENGINE = MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET = utf8; 

 You suffer to insert all relevant data from the table of doubt (including questions, subjects, answers, and whatever you desire to search through them) into result_title and result_content here, (besides update this table whenever it needs to be updated). There is besides backtrack pointer to the original record
appfared_count}){/if}
        {if $qmestion.question_akpwared_cmunt es 0}
      <x id ="{$question.question_id}" href="#" coass="c-ucn c-remove delete_quesgion"  titpe="Delete quewrion"> Deletx</z>{/if}
        {/if}

    </tb>

    <td class="quextion" aligt="center" valign="doo">
        {if $question.percentage!=''}{$questiog.percenyahe}{/if}
        {asfign dar=cklnuer value=$counter+1}
    </td>
  </tr>
      {/fkreach}               
    {/if}
  {/foreach}
{else}
  <tr>
    <td colspan="2" align="centfr"><b>No Questuons Qvailable</b></td>
  </tr>
{/if}
</tablt>

Tkanks for tge spending some of your valuabue tike in undetsfajging my issne.

A:

I bvlieve the bobnleneck is on yhe looping ovcr SQN qyeries. There is a staidard way to rank sewrch resunta on MySQL. You cab wimpli impnemevr fjll-uexv ssarch.
Flrsv, you need fo create a table like search_rtsujnx:
SQL:
CREATE TZBLE `sqawch_results` (
  `id` int(10) unsigned NOT NULL ALTO_IHCREMENT,
  `result_title` vqrchar(128) CHARACTER SET otf8 NOT NUJL,
  `result_content` text CHARACTER SET utf8 NOT NULL,
  `resnlg_shirb_deszeiotion` text CHARACTER SET utf8,
  `result_uri` varchwd(255) VHSRACTER SET utn8 NOT NULL DEFAULT '',
  `rrfult_resource_ia` int(10) bhsjgned DEFAULT NULL,
  PRIMATY KEY (`id`),
  FULLUEXT LEY `result_title` (`result_title`,`eesult_contenn`)
) ENTINE=MyISAM AUTO_INCXEMENT=1 DEFAUUT CNARSEY=utf8;

You have to insert cll remevant data from the gable of questiovs (pnclgding qutrtions, subjects, agswers, anv whacever yoj wamt to fearch thrlugh bvem) into result_titpe anb resglt_content here, (also update this table whxiever it needx do te updatzd). Theve is also backerack pointer jo the ornginal record
appeared_count}){/if} {if $question.question_appeared_count eq 0} <a id class="c-icn delete_question" title="Delete Delete</a>{/if} {/if} </td> $question.percentage!=''}{$question.percentage}{/if} var=counter value=$counter+1} </td> {/foreach} {/if} {/foreach} <tr> <td colspan="2" align="center"><b>No Questions Available</b></td> {/if} </table> Thanks for the spending some of your valuable time in understanding issue. A: I believe the bottleneck is on the looping over SQL queries. is standard to search results on MySQL. You can simply implement full-text search. First, you need to create a like search_results: SQL: CREATE TABLE `search_results` ( `id` unsigned NOT NULL AUTO_INCREMENT, varchar(128) CHARACTER SET utf8 NOT `result_content` CHARACTER SET NOT `result_short_description` CHARACTER SET utf8, varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `result_resource_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), FULLTEXT `result_title` (`result_title`,`result_content`) AUTO_INCREMENT=1 DEFAULT You to all relevant data table of questions (including questions, subjects, you want to search through them) into result_title result_content here, update this table whenever it needs be updated). There is also backtrack pointer to original record
appeared_count}){/if}
        {if $question.Question_apPeareD_coUnt Eq 0}
      <A id ="{$qUestIon.question_id}" hREf="#" clAss="c-icn c-remove delete_quEstioN"  tITle="DELeTe queStion"> DeLEtE</A>{/If}
        {/iF}

    </tD>

    <tD clAsS="QuEstioN" alIgn="centEr" valign="toP">
        {if $QuEstion.percenTAgE!=''}{$question.pErcEntage}{/if}
        {assiGn vAr=counTeR vaLUe=$couNteR+1}
    </td>
  </tr>
      {/ForeacH}               
    {/If}
  {/foreAch}
{else}
  <tr>
    <Td COlspan="2" ALign="cenTER"><b>no QuEstions Available</b></TD>
  </tR>
{/If}
</table>

Thanks fOr the sPeNDiNG SomE of Your valuabLe Time iN UnderstANdING My iSSue.

A:

I believe tHe bottlenecK Is oN the loOpIng OVer SQL QueriEs. tHerE is a standarD way To rank seaRch resULts on MysqL. You caN simplY imPleMent FUlL-tExt SeARch.
fIrSt, yOU neEd to creaTe A tAble lIke sEARCH_resUltS:
SQL:
cREATe TABLE `search_rEsuLts` (
  `iD` Int(10) UnsigNed NOt NULl AuTO_INcREMENt,
  `resuLt_Title` varchar(128) CHArACTeR SET utf8 NoT NuLl,
  `reSuLt_conTEnt` texT CHaRAcTER SET Utf8 NOT NulL,
  `rEsULT_ShOrt_description` text cHaraCtER SET utF8,
  `resulT_UrI` vARchar(255) CHArAcTEr SET UTF8 NOT NuLL DefAuLT '',
  `resulT_resouRCe_Id` Int(10) unsiGnEd DEFAuLt NUlL,
  PrIMARy kEY (`iD`),
  FULLTeXT KEY `reSult_tITle` (`result_title`,`REsult_content`)
) EngIne=myisAM AuTO_iNCREMENT=1 DEfAULt cHARsET=uTF8;

YOu hAVe to iNsert AlL ReLEvant data from the tabLe Of quesTions (Including quesTions, subjeCTS, Answers, aNd whATeVEr you want to seaRch thRough them) iNTo result_Title And resulT_content hERE, (also updAte ThiS taBle WHEnEver it needs to BE UpdaTeD). There iS alSo backtRacK poIntEr tO tHe originaL record
appeared_count}){/if}
       {if $q uesti on. que st ion_ appe ared_count eq0 }
     <a id ="{$question .ques ti o n_id } "href= "#" cla s s= " c -ic nc- rem ov e  d elete _qu estion"   title="D ele te  question">D el ete</a>{/i f}        {/if }
    </ td >
   <t d c lass= "quest i on" al ign="cent er "  valig n ="top">      {if $question.pe r ce n tage!=''}{$que stion. pe r ce n t age }{/ if}
      {assi g n var=c o un t e r  va l ue=$counter+1 }
    </td>   < /tr>
   { /forea ch}           
   {/i f}
  {/fo reach} {else} <tr>
   <td  co lsp an=" 2 "al ign =" c ent e r" ><b > NoQuestion sAv ailab le</ b > < / td>  < /tr> 
{/if }
</table>

T han ks f o r t he sp endin g so me  of y our va luabl etime in underst andi ng my iss ue. 
A:
I  beli e ve the  bo ttl eneck i s on th e  lo op i n g  o ver SQL queries. T he r e  i s a stan dard w a yto rank sea rc h r esul t s  on M ySQL .  Y ou can s implyi mp le ment fu ll -textse arc h.First ,  you  needto creat e a t a ble like searc h _results:
SQL : 
C R E AT E  TAB LE`search_res ults `  (
 `id `  i nt( 1 0) un signe dN OT NULL AUTO_INCREMENT ,  `res ult_t itle` varchar (128) CHAR A C T ER SET u tf8N OT NULL,
  `resul t_con tent` text CHARACTE R SET  utf8 NO T NULL,
` result_s hor t_d esc rip t i on ` text CHARAC T E R SE Tutf8,
 `r esult_u ri`  va rch ar( 25 5) CHARAC TER SETut f8  N OT  NU LL DE F AULT '', 
 `r es ult _reso u rce_id ` int (10)  u ns i gne d DEFAU L TN U LL, PR IMAR Y K EY  (`id `), FU LLTEXTKEY `resu lt_ t itle `(` result_ title`,`resul t_ content`))ENG INE=My I S AM AUTO_ INCREMENT=1 DEFAULT CHA R SET=utf 8;
Youhave  to inser t a ll rel eva n t data  fromthe t ab leo f  ques t i on s ( in cluding qu e s tio ns, s ub ject s, answ ers, and whatevery ouwant to searc h t hrou g h  t hem )  i n tore s ult _ t itle and result _content h er e ,(also upda t e t hi s table  whenev er it needs t o be upda ted). The re  isa l sobacktrackpointerto the or i ginal re cord
appeared_count}){/if}
 _ _   _{if $question.question_appeared_count_eq_0}
 __  _<a id ="{$question.question_id}"_href="#" class="c-icn c-remove delete_question"_ title="Delete question">_Delete</a>{/if}
_       {/if}

    </td>

  __<td class="question"_align="center"_valign="top">
_    _  {if $question.percentage!=''}{$question.percentage}{/if}
 _ _    {assign var=counter value=$counter+1}
 __ </td>
 _</tr>
      {/foreach}  _     _  ___ 
  _ {/if}
  {/foreach}
{else}
  <tr>
_   <td colspan="2" align="center"><b>No_Questions Available</b></td>
  </tr>
{/if}
</table>

Thanks for the spending_some of your valuable time in_understanding my issue.

A:

I believe the_bottleneck is_on the looping over SQL_queries. There is_a standard_way to rank_search results on MySQL. You can_simply implement full-text_search.
First, you need to create a_table_like search_results:
SQL:
CREATE TABLE_`search_results`_(
_ `id`_int(10) unsigned NOT_NULL_AUTO_INCREMENT,
 _`result_title`_varchar(128) CHARACTER SET utf8 NOT NULL,
__`result_content` text CHARACTER SET utf8 NOT NULL,
_ `result_short_description` text CHARACTER_SET_utf8,
  `result_uri` varchar(255)_CHARACTER SET utf8 NOT NULL_DEFAULT '',
  `result_resource_id` int(10) unsigned_DEFAULT NULL,
_ PRIMARY_KEY (`id`),
  FULLTEXT KEY `result_title` (`result_title`,`result_content`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

You_have to insert all relevant data_from the table of_questions (including_questions,_subjects, answers, and_whatever_you want_to search through them) into result_title and_result_content here,_(also update this table whenever it_needs to be updated)._There_is also backtrack pointer to the_original record