0
Hello folks was doing a search around here and would like to know how do I search for out-of-order terms
example I have a table with the following name: name_prod
in it is an example of a name:
BUSINESS CARD - 4X0- COUCHE BRIGHTNESS 250GRS / ROUNDED CORNER
I wish I could do a search where I could search for example:
cardboard 4x0 rounded couche
and the result appears, is there any way to do this? follows my code:
<?php
// Incluir aquivo de conexão
include("Connections/conn2.php");
// Recebe o valor enviado
$valor = $_GET['valor'];
// Procura titulos no banco relacionados ao valor
$sql = $conn1->query("SELECT * FROM cad_produtos WHERE nome_prod LIKE '%".$valor."%' OR codigo_prod LIKE '%".$valor."' OR tipo_prod LIKE '%".$valor."' ORDER BY codigo_prod ASC");
echo "<div class=\"row\" style=\"justify-content:center;\">\n";
if ($sql) {
while ($prod = $sql->fetch_object()) {
$variavel = $prod->tipo_prod;
$imgse = $conn1->query("SELECT `arquivo` FROM cad_prodrutos_tipo_prod WHERE tipo_prod='$variavel' ");
if ($imgse->num_rows > 0) {
while($imgrow = $imgse->fetch_object()) {
$variavel_limpa = strtolower( preg_replace("/[ -]+/", "-", strtr(utf8_decode(trim($variavel)), utf8_decode("áàãâéêíóôõúüñçÁÀÃÂÉÊÍÓÔÕÚÜÑÇ"),"aaaaeeiooouuncAAAAEEIOOOUUNC-")) );
$valor = $prod->valor_uni;
$Preco = number_format($valor,2,",",".");
?>
<?php
echo " <div class=\"card_prod card_prod--19\" >\n";
echo " <div class=\"card_prod__header card_prod__header--19\">\n";
echo " <div class=\"card_prod__watermark\" data-watermark=\"plus\"></div>\n";
echo "\n";
echo " <img src=\"assets/img/brand/logo.png\" alt=\"Nike\" class=\"card_prod__logo \">\n";
echo "\n";
echo " <span class=\"card_prod__price \">R$ $Preco </span>\n";
echo "\n";
echo " <h1 class=\"card_prod__title text-white \">$prod->nome_prod</h1>\n";
echo " <span class=\"card_prod__subtitle text-uppercase\">$prod->desc_prod</span>\n";
echo "\n";
echo " </div>\n";
echo "\n";
echo " <div class=\"card_prod__body\">\n";
echo " <img src=\"upload/$imgrow->arquivo\" alt=\"Nike 19\" class=\"card_prod__image\">\n";
}
} else {
echo "<center>"."<h1>"."Não há produtos!"."<div>"."<small class="."text-muted".">"."Cadastre um para visualizar!"."</small>"."</div>"."</h1>"."</center>";
}
echo "\n";
echo " <span class=\"card_prod__category \">COD:$prod->codigo_prod</span>\n";
echo " <span class=\"card_prod__category \">$prod->tamanho1_prod cm X $prod->tamanho2_prod cm</span>\n";
echo " <span class=\"card_prod__category \">$prod->tipo_prod</span>\n";
echo " </div>\n";
echo " </div>\n";
}
}else{
die($conn1->error);
}
?>
thank you very much was that same I needed was breaking my head because I am beginner
– Daniel Ricardo
@Danielricardo, note that it is STILL NECESSARY that the terms are in order. If it is required that this be different comments here that alternative step. I passed this, simpler, on account of the description of the question.
– tvdias
and what it would be like to have disorderly terms
– Daniel Ricardo
blz Thank you so much I’m on hold
– Daniel Ricardo
thank you very much, now the research became perfect I go from the researched ruma in what you advised me, thank you very much
– Daniel Ricardo
sorry to bother you but could help me in another matter?
– Daniel Ricardo
and that I asked a question and since yesterday nobody answered to pick up fields a specific field when you clone it with javascript
– Daniel Ricardo
https://answall.com/questions/433698/como-especificar-o-campo-input-clonado-js
– Daniel Ricardo