Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/09/2016, 09:16
VR1387
 
Fecha de Ingreso: abril-2016
Mensajes: 19
Antigüedad: 8 años
Puntos: 0
Respuesta: Jquery autompletado PHP MYSQL NO muestra informacion

Buenas este es el codigo arreglado.

Código:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
   		<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
   		<link href="css/jqueryui.css" type="text/css" rel="stylesheet"/>
        <script>
	       	$(document).ready(function(){
				$( "#nombre" ).autocomplete({
      				source: "jquery.php",
      				minLength: 1
    			});
			});
        </script>

    </head>
<title>Busqueda de  marcajes</title>
<body>
<center>
<form action="buscar.php" method="post">
<table border="2" bordercolor="#151515" bgcolor="#F7F8E0">
<tr>
		<td><center>Nombre del empleado</center>
		</td>
		<td>
		<input title = "Escribe el nombre en mayuscula"  type="text" id = "nombre" size="22"  name="nombre">
		<center><input type="submit" name="buscar" value="Buscar"></center>
		</td>
</tr>
<tr>
		<td><center>Sede</center>
		</td>
		<td>
		<input title = "Escribe el nombre en mayuscula" required = "required" type="text" size="22"  name="sede">
		<center><input type="submit" name="buscar" value="Buscar"></center>
		</td>
</tr>

		<td>Seleccionar fecha inicio:
	    <input type="date" name="fecha_i" required="required" step="1" min="2016-01-01" max="2018-12-31" value="<?php echo date("Y-m-d");?>">
		</td>
		<td>
		Seleccionar fecha final:
			<input type="date" name="fecha_f" required="required" step="1" min="2016-01-01" max="2018-12-31" value="<?php echo date("Y-m-d");?>">
		</td>
		</tr>
</table>
</form>
		<input type="submit" name="regresar" value="Regresar al inicio" onclick="location='index.php'">
</center>
</body>
</html>
jquery.php

Código:
<?php

 //database configuration
require "conexion.php";

    //connect with the database


    //get search term
    $term = $_POST['term'];
    //get matched data from skills table
    $consulta = mysql_query("SELECT trab_cedula, trab_nombre, trab_apellido FROM tb_trab WHERE trab_nombre LIKE '%$term%' ORDER BY trab_nombre ASC",$con);

	while ($array = mysql_fetch_array($consulta)) {
        $data[] = $array['trab_cedula']." ".$array['trab_nombre']." ".$array['trab_apellido'];
        //echo $array['trab_cedula']." ".$array['trab_nombre']." ".$array['trab_apellido'];
    }
  echo json_encode($data);
?>
Y no hace nada de nada jquery.php si me muestra los datos sin problemas.