mi tienda en linea

Resultados de la búsqueda


[insert_php]
include(“../include/conexion_db.php”);
mysql_set_charset(‘utf8’);
$i = 0;
$cadena =$_POST[“producto”];

$cadena1 = $cadena;
$parte = explode(” “,$cadena1);

// saca id ultimo
$rs = mysql_query(“SELECT MAX(id) AS id FROM buscador”);
if ($row = mysql_fetch_row($rs)) {
$id = trim($row[0]);
}
$id = $id+1;

// saca ip
$IP_ADDRESS = $_SERVER[REMOTE_ADDR];

//saca hora y fecha
$fecha = date(“Y-n-j”);
$hora = date(“H:i:s”);

//ALTA EN BASE DE DATOS

$query = “INSERT INTO buscador(id, palabra, fecha, hora, ip) VALUES (‘$id’,’$cadena’,’$fecha’, ‘$hora’, ‘$IP_ADDRESS’)”;

$bandera=mysql_query($query);

// busca lapabra
$result = mysql_query(“SELECT * FROM productos WHERE desc_producto LIKE ‘%{$cadena}_%'”);
$row = mysql_num_rows ($result);
//echo $row;

$f1 =0; $f2=1; $f2=2;

if ($row){

echo “Se encontraron ” . $row .” resultado de la busqueda “;echo $cadena;
echo “
“;
echo “
“;
echo “
“;

while ($row1=mysql_fetch_array($result)){
$id_p[$i] = $row2[‘id’];
$id_usuario[$i] = $row1[‘id_usuario’];
$id_producto[$i] = $row1[‘id_producto’];
$img_producto[$i] = $row1[‘img_producto’];
$desc_producto[$i] = $row1[‘desc_producto’];
$x = $id_usuario[$i];

echo “

“;

echo “

“;
$ruta_img = “/imagenes/productos/”.$img_producto[$i];
echo ““;
echo “
“;
echo “
“;

echo $desc_producto[$i];
echo “
“;
echo “
“;

// botones de contacto
$result2 = mysql_query(“SELECT * FROM proveedores WHERE id = ‘$x'”);
$row2 = mysql_fetch_assoc ($result2) or die(‘Consulta fallida: ‘ . mysql_error());
$whatssap_prove1=$row2[“whatssap_prove”];
$face1=$row2[“face”];
$categoria1=$row2[“categoria”];

echo ““;
echo “

“.”Más sobre el proveedor”. “
“;
echo “
“;

echo “Contacto con el proveedores”;
echo “
“;
if ($whatssap_prove1 != “”){

echo ““; echo ” “;
/*
echo ““;
echo ” “; */
}

if ($face1){
echo ““;
echo ” “;
/*
echo ““;
echo ” “; */
}

echo “
“;
echo “
“;
echo “

“;
echo “

“;

echo “
“;
echo “
“;
echo “
“;
echo “
“;

$i++;
} //fin de while 1

} // if busqueda exacta

$cadena = $parte[0];

$result100 = mysql_query(“SELECT * FROM productos WHERE desc_producto LIKE ‘%{$cadena}_%'”);
$row100 = mysql_num_rows ($result100);

$f1 =0; $f2=1; $f2=2;
if ($row100){

//echo “Resultados de la búsqueda no exactos “;

//echo $cadena;
echo “
“;
echo “
“;
echo “
“;

while ($row100=mysql_fetch_array($result100)){
$id_p[$i] = $row100[‘id’];
$id_usuario[$i] = $row100[‘id_usuario’];
$id_producto[$i] = $row100[‘id_producto’];
$img_producto[$i] = $row100[‘img_producto’];
$desc_producto[$i] = $row100[‘desc_producto’];
$x = $id_usuario[$i];

echo “

“;

$ruta_img = “/imagenes/productos/”.$img_producto[$i];
echo ““;
echo “
“;
echo “
“;

echo $desc_producto[$i];
echo “
“;
echo “
“;

// botones de contacto
$result2 = mysql_query(“SELECT * FROM proveedores WHERE id = ‘$x'”);
$row2 = mysql_fetch_assoc ($result2) or die(‘Consulta fallida: ‘ . mysql_error());
$whatssap_prove1=$row2[“whatssap_prove”];
$face1=$row2[“face”];
echo “Contacto con el proveedores”;
echo “
“;
if ($whatssap_prove1 != “”){

echo ““; echo ” “;
/*
echo ““;
echo ” “; */
}

if ($face1){
echo ““;
echo ” “;
/*
echo ““;
echo ” “; */
}

echo “
“;
echo “
“;
echo “

“;
echo “
“;
echo “
“;
echo “
“;
echo “
“;
$i++;
} //fin de while 2

}else{
echo ““;
}

//MEJORAR BUSQUEDA POR CATEGORIA
//$result2 = mysql_query(“SELECT * FROM proveedores WHERE id = ‘$cadena'”);
//$row2 = mysql_fetch_assoc ($result2);

[/insert_php]

close

Regístrate GRATIS a la comunidad de emprendedores y negocios comercialízate y obtén miles de beneficios

Comercializate
Logo
Enable registration in settings - general
Shopping cart