Estoy creando un buscador personalizado, pero este debe de funcionar de la siguiente forma.
Tengo una tabla y los registros:
Cada registro tiene que compararse con una palabra que ingresa el usuario, quedar asi:
select @ from MiTabla
registro_1 like %minombre% or
registro_2 like %minombre% or
registro_3 like %minombre% or
registro_4 like %minombre% or
registro_5 like %minombre% or
registro_6 like %minombre%
Tengo estos registros, pueden ser desde 1 hasta n registros.
MiTabla_1
registro_1
registro_2
registro_3
registro_4
registro_5
registro_6
MiTabla_2
registro_1
registro_2
eso porfavor...
uso:
PHP 5
MySQL 5
S.O: Windows XP
Código PHP:
Ver original<?php
$link=conexion();
$conn = "select * from MiTabla_1";
{
$micampo1 = $row[micampo1];
// Es aqui que no logro hacer.
echo "$micampo1";
$array = array($micampo1);
foreach ($array as $i => $value) {
echo "$array[$i]";
$conn2 = "select * from MiTabla_1 where registro_[$i] = $array[$i]";
/*
$conn2 = "select * from MiTabla_1 where
registro_1 = $registro_1 and
registro_2 = $registro_2 and
registro_3 = $registro_3 and
registro_4 = $registro_4 and
registro_5 = $registro_5 and
registro_6 = $registro_6 and
";
*/
}
}
?>