Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_GET['term'])){
- $string = $_GET['term'];
- }else{
- $string = "";
- }
- $result = mysqli_query ($conexion, "SELECT * FROM paciente where run like '%$string%'");
- if ($result){
- $array = [];
- $array_respuesta=[];
- while ($row = mysqli_fetch_assoc($result)){
- //print_r($row);
- $array['label'] =$row ['run'];
- $array['nombre_persona'] =$row ['nombre'];
- $array['apellido_persona'] =$row ['apellido'];
- array_push($array_respuesta, $array);
- }
- echo json_encode($array_respuesta);
- }
- if(isset($_GET['term']))
- {
- $string2 = $_GET['term'];
- }else{
- $string2 = "";
- }
- $result2 = mysqli_query ($conexion, "SELECT * FROM funcionario where run_funcionario like '%$string2%'");
- if ($result2){
- $array2 = [];
- $array_respuesta2=[];
- while ($row2 = mysqli_fetch_assoc($result2)){
- //print_r($row);
- $array2['run_f'] =$row2 ['run_funcionario'];
- $array2['nombre_funcionario'] =$row2 ['nombre'];
- $array2['apellido_funcionario'] =$row2 ['apellido'];
- array_push($array_respuesta2, $array2);
- }
- echo json_encode($array_respuesta2);
- }
- if(isset($_GET['term'])){
- $string = $_GET['term'];
- }else{
- $string = "";
- }
- $result = mysqli_query ($conexion, "SELECT * FROM paciente where run like '%$string%'");
- if ($result){
- $array = [];
- $array_respuesta=[];
- while ($row = mysqli_fetch_assoc($result)){
- //print_r($row);
- $array['label'] =$row ['run'];
- $array['nombre_persona'] =$row ['nombre'];
- $array['apellido_persona'] =$row ['apellido'];
- array_push($array_respuesta, $array);
- }
- echo json_encode($array_respuesta);
- }
- if(isset($_GET['term']))
- {
- $string2 = $_GET['term'];
- }else{
- $string2 = "";
- }
- $result2 = mysqli_query ($conexion, "SELECT * FROM funcionario where run_funcionario like '%$string2%'");
- if ($result2){
- $array2 = [];
- $array_respuesta2=[];
- while ($row2 = mysqli_fetch_assoc($result2)){
- //print_r($row);
- $array2['run_f'] =$row2 ['run_funcionario'];
- $array2['nombre_funcionario'] =$row2 ['nombre'];
- $array2['apellido_funcionario'] =$row2 ['apellido'];
- array_push($array_respuesta2, $array2);
- }
- echo json_encode($array_respuesta2);
- }
- <label for="run_f">Podologa: </label>
- <input type="text" name="run_f" id="run_f">
- <br>
- <label for="nombre_f">Nombre: </label>
- <input type="text" name="nombre_f" id="nombre_f">
- <br>
- <label for="apellido_f">Apellido: </label>
- <input type="text" name="apellido_f" id="apellido_f">
Add Comment
Please, Sign In to add comment