
pollmix
Membros-
Total de itens
6 -
Registro em
-
Última visita
Tudo que pollmix postou
-
Não entendi bem o que você está querendo, mas se for limitar o resultado a apenas um registro, tente fazer isso em sua query. Utilizando por exemplo SELECT * FROM EXEMPLO where nome='exemplo' LIMIT 0,1, desta forma a query irá retornar apenas 1 resultado.
-
Gente eu preciso de uma ajuda urgente, estou a duas semanas reescrevendo este código e não consigo limitar o resultado eu preciso que ele de apenas uma resposta. Como esta logo abaixo com barra de busca e tudo, esta funcionando bem ate demais da as três ocorrências registrada, eu gostaria que ele imprimisse apenas uma linha. Alguém pode ajudar. Obrigado... Seque o código com barra e tudo <table width="734" style="margin:0; padding:0; border-collapse: collapse" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" border="0" height="39"> <tbody style="margin: 0; padding: 0"> <tr style="margin: 0; padding: 0"> <td height="39" width="773" bordercolor="#FFFFFF" bgcolor="#F8F8F8" style="margin:0; padding:0; font-family: arial, helvetica; color: #434343; font-size: 12px"> <form method="GET" style="margin: 0; padding: 0"> <p align="center"> <b style="margin: 0; padding: 0"> <font face="Verdana, Arial, Helvetica, sans-serif" color="#0000FF" style="margin: 0; padding: 0"> Busca </font></b><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF" style="margin: 0; padding: 0">.</font><font face="Verdana, Arial, Helvetica, sans-serif" size="19" style="margin: 0; padding: 0"><input type=text name=srchval value="" size="40" style="margin: 0; padding: 0"></u> <input type=submit value="Buscar" style="margin: 0; padding: 0"></font> <font face="Verdana, Arial, Helvetica, sans-serif" size="3" style="margin: 0; padding: 0"> Geral</font></td></tr> </font> </form> </td> </tr> </table> <p> </p> <p><!--webbot bot="HTMLMarkup" startspan --><script language=""> function kw_list () { this.keywords = new Array (); this.num_words = 0; this.query = ""; this.original_query = ""; this.query_length = 0; this.possible_points = 0; this.multiple = points_keywords; this.get_words = get_query; this.no_query = no_query_found; } function get_query () { this.query = top.location.search.substring (top.location.search.indexOf ('=') + 1); while ((the_plus = (this.query.indexOf ("+", 0))) != -1) { this.query_length = this.query.length; this.query = this.query.substring (0, the_plus) + " " + this.query.substring (the_plus + 1); } this.original_query = unescape (this.query); this.query = this.original_query.toLowerCase (); this.query_length = this.query.length; if (this.query != "") { var query_pointer = 0; var end_word = 0; var at_end = 0; while ((this.num_words <= (max_keywords - 1)) && (! at_end)) { end_word = this.query.indexOf (" ", query_pointer); if (end_word == query_pointer) query_pointer++; else { if (end_word > (this.query_length - 1)) at_end = 0; if (end_word != -1) this.keywords[this.num_words] = (this.query.substring (query_pointer, end_word)); else { this.keywords[this.num_words] = this.query.substring (query_pointer, this.query_length); at_end = 1; } this.num_words++; if (query_pointer != -1) query_pointer = end_word + 1; if (query_pointer > (this.query_length - 1)) at_end = 1; } } if (this.num_words == 0) return (0); else { this.possible_points = this.multiple * this.num_words; return (1); } } else return (0); } function no_query_found () { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ('<CENTER><P></P></CENTER>'); } function entry (url, title, keywords, description) { this.url = url; this.title = title; this.keywords = keywords; this.description = description; this.points = 0; this.search_entry = find_keyword; this.print_entry = print_result; } function find_keyword (the_word) { var the_title = this.title.toLowerCase (); var the_keywords = this.keywords.toLowerCase (); if ((the_keywords.indexOf (the_word)) != -1) this.points += points_keywords; } function print_result (possible_points) { document.writeln ('<A target="_self" HREF="' + this.url + '" target="meio">' + this.title + '</A> - ' + this.description + '<br>'); } function no_entry_printed (the_query) { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ("<CENTER><P> Não há ocorrencia da palavra <U><B>" + the_query + "</B></U>.</P></CENTER>"); } function print_intro (the_query) { document.writeln ("<CENTER><P>Os resultados da pesquisa por <U><B>" + the_query + "</B><p></U> são:</P></CENTER>"); } function begin_search () { var key_list = new kw_list; var entry_printed = 0; if (! key_list.get_words ()) key_list.no_query (); else { var counter = 0; var counter2 = 0; for (counter = 0; counter < entry_num; counter++) for (counter2 = 0; counter2 <= (key_list.num_words - 1); counter2++) the_entries[counter].search_entry (key_list.keywords[counter2]); for (counter = key_list.possible_points; counter > 0; counter--) { for (counter2 = 0; counter2 < entry_num; counter2++) { if (counter == the_entries[counter2].points) { if (entry_printed != 1) { entry_printed = 1; print_intro (key_list.original_query); } the_entries[counter2].print_entry (key_list.possible_points); } } } if (! entry_printed) no_entry_printed (key_list.original_query); } } the_entries = new Array (); the_entries[0] = new entry ("http://URL DO SITE", "<B><FONT color=#005bb7>TITULO- </FONT></B><B><FONT color=#0263C4>DESCRIÇÃO VISIVEL</FONT></B><p><FONT color=#009933>URL</FONT></p>", "PALAVRA CHAVE, " , "DESCRIÇÃO.<br>"); the_entries[1] = new entry ("http://URL DO SITE", "<B><FONT color=#005bb7>TITULO- </FONT></B><B><FONT color=#0263C4>DESCRIÇÃO VISIVEL</FONT></B><p><FONT color=#009933>URL</FONT></p>", "PALAVRA CHAVE, " , "DESCRIÇÃO.<br>"); the_entries[2] = new entry ("http://URL DO SITE", "<B><FONT color=#005bb7>TITULO- </FONT></B><B><FONT color=#0263C4>DESCRIÇÃO VISIVEL</FONT></B><p><FONT color=#009933>URL</FONT></p>", "PALAVRA CHAVE, " , "DESCRIÇÃO.<br>"); the_entries[3] = new entry ("http://URL DO SITE", "<B><FONT color=#005bb7>TITULO- </FONT></B><B><FONT color=#0263C4>DESCRIÇÃO VISIVEL</FONT></B><p><FONT color=#009933>URL</FONT></p>", "PALAVRA CHAVE, " , "DESCRIÇÃO.<br>"); var entry_num = 4; var max_keywords = 1; var points_title = 4; var points_keywords = 4; var points_description = 4; begin_search (); </script>
-
Pessoal estou com um problema tenho este código de busca interna que já esta em funcionamento mas gerou um problema ele não divide ou seja não gera uma nova pagina após ex: 15 resultados. O que ele faz e postar todos em um único lugar. Será que da pra arrumar e fazer com que ele a cada 15 resultados gere uma nova pagina. Certo este script acima pode rodar em PHP em HTML em ASP em fim ele esta rodando normal sem erro algum – o que eu queria e acrescentar mais um comando, ou seja limitar a pesquisa e dividi-la. O codigo e esse: <script language=""> function kw_list () { this.keywords = new Array (); this.num_words = 0; this.query = ""; this.original_query = ""; this.query_length = 0; this.possible_points = 0; this.multiple = points_title + points_keywords + points_description; this.get_words = get_query; this.no_query = no_query_found; } function get_query () { this.query = top.location.search.substring (top.location.search.indexOf ('=') + 1); while ((the_plus = (this.query.indexOf ("+", 0))) != -1) { this.query_length = this.query.length; this.query = this.query.substring (0, the_plus) + " " + this.query.substring (the_plus + 1); } this.original_query = unescape (this.query); this.query = this.original_query.toLowerCase (); this.query_length = this.query.length; if (this.query != "") { var query_pointer = 0; var end_word = 0; var at_end = 0; while ((this.num_words <= (max_keywords - 1)) && (! at_end)) { end_word = this.query.indexOf (" ", query_pointer); if (end_word == query_pointer) query_pointer++; else { if (end_word >= (this.query_length - 1)) at_end = 1; if (end_word != -1) this.keywords[this.num_words] = (this.query.substring (query_pointer, end_word)).toLowerCase (); else { this.keywords[this.num_words] = this.query.substring (query_pointer, this.query_length); at_end = 1; } this.num_words++; if (query_pointer != -1) query_pointer = end_word + 1; if (query_pointer > (this.query_length - 1)) at_end = 1; } } if (this.num_words == 0) return (0); else { this.possible_points = this.multiple * this.num_words; return (1); } } else return (0); } function no_query_found () { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ('<CENTER><P></P></CENTER>'); } function entry (url, title, keywords, description) { this.url = url; this.title = title; this.keywords = keywords; this.description = description; this.points = 0; this.search_entry = find_keyword; this.print_entry = print_result; } function find_keyword (the_word) { var the_title = this.title.toLowerCase (); var the_keywords = this.keywords.toLowerCase (); var the_description = this.description.toLowerCase (); if ((the_title.indexOf (the_word)) != -1) this.points += points_title; if ((the_keywords.indexOf (the_word)) != -1) this.points += points_keywords; if ((the_description.indexOf (the_word)) != -1) this.points += points_description; } function print_result (possible_points) { document.writeln ('<A target="_self" HREF="' + this.url + '" target="meio">' + this.title + '</A> - ' + this.description + '<br>'); } function no_entry_printed (the_query) { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ("<CENTER><P> Não há ocorrencia da palavra <U><B>" + the_query + "</B></U>.</P></CENTER>"); } function print_intro (the_query) { document.writeln ("<CENTER><P>Os resultados da pesquisa por <U><B>" + the_query + "</B></U> são:</P></CENTER>"); } function begin_search () { var key_list = new kw_list; var entry_printed = 0; if (! key_list.get_words ()) key_list.no_query (); else { var counter = 0; var counter2 = 0; for (counter = 0; counter < entry_num; counter++) for (counter2 = 0; counter2 <= (key_list.num_words - 1); counter2++) the_entries[counter].search_entry (key_list.keywords[counter2]); for (counter = key_list.possible_points; counter > 0; counter--) { for (counter2 = 0; counter2 < entry_num; counter2++) { if (counter == the_entries[counter2].points) { if (entry_printed != 1) { entry_printed = 1; print_intro (key_list.original_query); } the_entries[counter2].print_entry (key_list.possible_points); } } } if (! entry_printed) no_entry_printed (key_list.original_query); } } the_entries = new Array (); //aqui vai as entradas para a pesquisa the_entries[0] = new entry ("http://url", " <IMG SRC=image.jpg> Detalhe", "palavra chave, ", "descrição.<br>"); the_entries[1] = new entry ("http://url", " <IMG SRC=image.jpg> Detalhe", "palavra chave, ", "descrição.<br>"); //abaixo vai o número de entradas existentes var entry_num = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var max_keywords = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_title = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_keywords = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_description = 1; begin_search (); </script> </script> <body> </div> </div> </div> <p>
-
Não sei se estou no lugar certo. Já postei em outro lugar e não era lá. Desculpe pessoal nunca usei fórum e a primeira vez. Pessoal estou com um problema tenho este código de busca interna que já esta em funcionamento mas gerou um problema ele não divide ou seja não gera uma nova pagina. ex: 15 resultados. O que ele faz e postar todos resultados em um único lugar. Será que da pra arrumar e fazer com que ele após 15 resultados gere uma nova pagina. Ele esta rodando normal sem erro algum – o que eu queria e acrescentar mais um comando, ou seja limitar a pesquisa e dividi-la. E quem quiser usar o código como ele esta vou posta-lo abaixo: <div align="center" style="width: 773; height: 96"> <table width="718" style="border-collapse: collapse" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" border="0" height="2"> <tr> <td height="2" width="757" bordercolor="#FFFFFF" bgcolor="#F8F8F8" style="font-family: arial, helvetica; color: #434343; font-size: 12px"> <form method="GET"> <p align="center"> <script language=""> function kw_list () { this.keywords = new Array (); this.num_words = 0; this.query = ""; this.original_query = ""; this.query_length = 0; this.possible_points = 0; this.multiple = points_title + points_keywords + points_description; this.get_words = get_query; this.no_query = no_query_found; } function get_query () { this.query = top.location.search.substring (top.location.search.indexOf ('=') + 1); while ((the_plus = (this.query.indexOf ("+", 0))) != -1) { this.query_length = this.query.length; this.query = this.query.substring (0, the_plus) + " " + this.query.substring (the_plus + 1); } this.original_query = unescape (this.query); this.query = this.original_query.toLowerCase (); this.query_length = this.query.length; if (this.query != "") { var query_pointer = 0; var end_word = 0; var at_end = 0; while ((this.num_words <= (max_keywords - 1)) && (! at_end)) { end_word = this.query.indexOf (" ", query_pointer); if (end_word == query_pointer) query_pointer++; else { if (end_word >= (this.query_length - 1)) at_end = 1; if (end_word != -1) this.keywords[this.num_words] = (this.query.substring (query_pointer, end_word)).toLowerCase (); else { this.keywords[this.num_words] = this.query.substring (query_pointer, this.query_length); at_end = 1; } this.num_words++; if (query_pointer != -1) query_pointer = end_word + 1; if (query_pointer > (this.query_length - 1)) at_end = 1; } } if (this.num_words == 0) return (0); else { this.possible_points = this.multiple * this.num_words; return (1); } } else return (0); } function no_query_found () { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ('<CENTER><P></P></CENTER>'); } function entry (url, title, keywords, description) { this.url = url; this.title = title; this.keywords = keywords; this.description = description; this.points = 0; this.search_entry = find_keyword; this.print_entry = print_result; } function find_keyword (the_word) { var the_title = this.title.toLowerCase (); var the_keywords = this.keywords.toLowerCase (); var the_description = this.description.toLowerCase (); if ((the_title.indexOf (the_word)) != -1) this.points += points_title; if ((the_keywords.indexOf (the_word)) != -1) this.points += points_keywords; if ((the_description.indexOf (the_word)) != -1) this.points += points_description; } function print_result (possible_points) { document.writeln ('<A target="_self" HREF="' + this.url + '" target="meio">' + this.title + '</A> - ' + this.description + '<br>'); } function no_entry_printed (the_query) { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ("<CENTER><P> Não há ocorrencia da palavra <U><B>" + the_query + "</B></U>.</P></CENTER>"); } function print_intro (the_query) { document.writeln ("<CENTER><P>Os resultados da pesquisa por <U><B>" + the_query + "</B></U> são:</P></CENTER>"); } function begin_search () { var key_list = new kw_list; var entry_printed = 0; if (! key_list.get_words ()) key_list.no_query (); else { var counter = 0; var counter2 = 0; for (counter = 0; counter < entry_num; counter++) for (counter2 = 0; counter2 <= (key_list.num_words - 1); counter2++) the_entries[counter].search_entry (key_list.keywords[counter2]); for (counter = key_list.possible_points; counter > 0; counter--) { for (counter2 = 0; counter2 < entry_num; counter2++) { if (counter == the_entries[counter2].points) { if (entry_printed != 1) { entry_printed = 1; print_intro (key_list.original_query); } the_entries[counter2].print_entry (key_list.possible_points); } } } if (! entry_printed) no_entry_printed (key_list.original_query); } } the_entries = new Array (); //aqui vai as entradas para a pesquisa the_entries[0] = new entry ("http://url", " Detalhe ou nomes ", "palavra chave, ", "descrição.<br>"); the_entries[1] = new entry ("http://url", " Detalhe ou nomes ", "palavra chave, ", "descrição.<br>"); //abaixo vai o número de entradas existentes var entry_num = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var max_keywords = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_title = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_keywords = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_description = 1; begin_search (); </script> </script> <body> </div> </div> </div> <p>
-
Por Favor será que ninguém sabe me informar nada pelo menos se e possível.
-
Pessoal estou com um problema tenho este código de busca interna que já esta em funcionamento mas gerou um problema ele não divide ou seja não gera uma nova pagina após ex: 15 resultados. O que ele faz e postar todos em um único lugar. Será que da pra arrumar e fazer com que ele após 15 resultados gere uma nova pagina. Não sei se estou no lugar certo. Sou novo aqui. seque o código abaixo: <script language=""> function kw_list () { this.keywords = new Array (); this.num_words = 0; this.query = ""; this.original_query = ""; this.query_length = 0; this.possible_points = 0; this.multiple = points_title + points_keywords + points_description; this.get_words = get_query; this.no_query = no_query_found; } function get_query () { this.query = top.location.search.substring (top.location.search.indexOf ('=') + 1); while ((the_plus = (this.query.indexOf ("+", 0))) != -1) { this.query_length = this.query.length; this.query = this.query.substring (0, the_plus) + " " + this.query.substring (the_plus + 1); } this.original_query = unescape (this.query); this.query = this.original_query.toLowerCase (); this.query_length = this.query.length; if (this.query != "") { var query_pointer = 0; var end_word = 0; var at_end = 0; while ((this.num_words <= (max_keywords - 1)) && (! at_end)) { end_word = this.query.indexOf (" ", query_pointer); if (end_word == query_pointer) query_pointer++; else { if (end_word >= (this.query_length - 1)) at_end = 1; if (end_word != -1) this.keywords[this.num_words] = (this.query.substring (query_pointer, end_word)).toLowerCase (); else { this.keywords[this.num_words] = this.query.substring (query_pointer, this.query_length); at_end = 1; } this.num_words++; if (query_pointer != -1) query_pointer = end_word + 1; if (query_pointer > (this.query_length - 1)) at_end = 1; } } if (this.num_words == 0) return (0); else { this.possible_points = this.multiple * this.num_words; return (1); } } else return (0); } function no_query_found () { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ('<CENTER><P></P></CENTER>'); } function entry (url, title, keywords, description) { this.url = url; this.title = title; this.keywords = keywords; this.description = description; this.points = 0; this.search_entry = find_keyword; this.print_entry = print_result; } function find_keyword (the_word) { var the_title = this.title.toLowerCase (); var the_keywords = this.keywords.toLowerCase (); var the_description = this.description.toLowerCase (); if ((the_title.indexOf (the_word)) != -1) this.points += points_title; if ((the_keywords.indexOf (the_word)) != -1) this.points += points_keywords; if ((the_description.indexOf (the_word)) != -1) this.points += points_description; } function print_result (possible_points) { document.writeln ('<A target="_self" HREF="' + this.url + '" target="meio">' + this.title + '</A> - ' + this.description + '<br>'); } function no_entry_printed (the_query) { document.writeln ('<link rel="stylesheet" href="gp.css">'); document.writeln ("<CENTER><P> Não há ocorrencia da palavra <U><B>" + the_query + "</B></U>.</P></CENTER>"); } function print_intro (the_query) { document.writeln ("<CENTER><P>Os resultados da pesquisa por <U><B>" + the_query + "</B></U> são:</P></CENTER>"); } function begin_search () { var key_list = new kw_list; var entry_printed = 0; if (! key_list.get_words ()) key_list.no_query (); else { var counter = 0; var counter2 = 0; for (counter = 0; counter < entry_num; counter++) for (counter2 = 0; counter2 <= (key_list.num_words - 1); counter2++) the_entries[counter].search_entry (key_list.keywords[counter2]); for (counter = key_list.possible_points; counter > 0; counter--) { for (counter2 = 0; counter2 < entry_num; counter2++) { if (counter == the_entries[counter2].points) { if (entry_printed != 1) { entry_printed = 1; print_intro (key_list.original_query); } the_entries[counter2].print_entry (key_list.possible_points); } } } if (! entry_printed) no_entry_printed (key_list.original_query); } } the_entries = new Array (); //aqui vai as entradas para a pesquisa the_entries[0] = new entry ("http://url", " <IMG SRC=image.jpg> Detalhe", "palavra chave, ", "descrição.<br>"); the_entries[1] = new entry ("http://url", " <IMG SRC=image.jpg> Detalhe", "palavra chave, ", "descrição.<br>"); //abaixo vai o número de entradas existentes var entry_num = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var max_keywords = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_title = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_keywords = 2; //aumenta de acordo com as obcoes de busca no caso 2 ate agora var points_description = 1; begin_search (); </script> </script> <body> </div> </div> </div> <p>