Greetings and thanks for the great information that we can find in these forums
to solve our doubts. But I have a problem and I have not been able to find solution, I
hope somebody can help me. This is the problem:
I want to create a searcher. In a form a user can enter a keyword that will look for
in the data base. A field type varchar(100) that contains key words like: "car,
travels, clothes"
This is my query:
Code:
mysql_connect("localhost","root","") or die ("No pude conectarme");
mysql_select_db("mibase") or die("No puedo acceder a la base de datos");
// This is the query
$res=mysql_query("SELECT * FROM `mitabla` WHERE `$campo` LIKE '%$palabra_clave%' ");
if(!mysql_fetch_array($res)){
echo "No se encontraron registros Registros";
}
else{
$con=0;
while($nd=mysql_fetch_array($res)){
$con++;
echo "Nombre: ".$nd[nombre]." puesto: " .$nd[puesto].
" conocimientos: ".$nd[conocimientos]."
";
}
echo "
Numero de registros: ".$con."";
}
This works partly. The search only gives back three records although the key word is
in more. Which is the problem?
thx for all sincerely