I happen to be implementing a search engine, but I want it to be searched by entering different values, I mean, I have a table that has 3 fields student_name, student_and student_name, what I want is that when entering a number display field values rut or if you have a letter that you look for in the field name or surname and show them, so far I have this on the server side (php).
$buscar = $_POST['b'];
if(!empty($buscar)) {
buscar($buscar);
}
function buscar($b) {
$con = mysql_connect('localhost','root', '12345678');
mysql_select_db('colegio_pool', $con);
$sql = mysql_query("SELECT * FROM alumno WHERE nombre_alumno LIKE '%".$b."%' LIMIT 10" ,$con);
$contar = @mysql_num_rows($sql);
if($contar == 0){
echo "No se han encontrado resultados para '<b>".$b."</b>'.";
}else{
while($row=mysql_fetch_array($sql)){
$nombre = $row['nombre_alumno'];
$rut = $row['rut_alumno'];
echo "<a><p class='alert alert-info' style='text-align:center'>".$nombre."</p></a>";
}
}
}
, how can I do to implement what I want? thanks in advance