Questions tagged as 'php'

2
answers

Abnormal foreach behavior in php 7.0, repeat the last element in nested foreach

I'm new here, and as the title says the foreach behaves abnormally. I want to list all the driver's schedules per shift (1 = day, 2 = night), in turn these with the days from Monday to Friday (0 = Sunday, 1 = Monday, etc) Bearing in mind that dr...
asked by 11.12.2017 / 22:46
2
answers

Differentiate columns using inner join

I have this code: $getAlumno = mysqli_query($con,"SELECT * FROM alumnos INNER JOIN modulos ON alumnos.nivel=modulos.ID WHERE alumnos.ID='$login'") or die ('error al obtener datos de alumno'); $row = mysqli_fetch_array($getAlumno,MYSQLI_ASS...
asked by 06.12.2017 / 08:04
1
answer

Get MySQL query data to print in HTML

I have a HTML form where I want to show a series of data obtained from a query in MySQL using SQL. Query: static public function obtenerAccesoriosPorCabana($idcabana){ $ejecucion = self::Conexion(); $sql = "SELECT...
asked by 12.12.2017 / 11:16
2
answers

Capture value confirm with php

My problem is that I press cancel or press accept in the confirm, it enters me anyway in the if. $comparar = true; $comparar_js = "<script type='text/javascript'>confirm('¿Borrar?')</script>"; echo($comparar_js); if($comparar==$c...
asked by 08.12.2017 / 12:47
1
answer

Error loading data with AJAX

Every time I give the button to load the AJAX, I load the start screen with everything (header, menu and footer) apart from not loading the data from the table I request. I get this error in the console: [Deprecation] Synchronous XMLHttpRequest...
asked by 18.11.2017 / 19:47
1
answer

Get JSON data

Greetings. I need to obtain the records of a specific row, through ajax I am sending the id to php and I get the row, but I am not able to manipulate the data and then assign them to html elements. Where will the error be? $(function() { $...
asked by 20.11.2017 / 19:43
1
answer

Calculate difference between two PHP dates [duplicated]

I want to know the difference in days between two dates given in the format: 2018/01/05 PHP Code: $diferencia_dias = $check_in->diff($check_out); echo $diferencia_dias->format('%R%a días'); Error: Fatal error: Call to a m...
asked by 02.01.2018 / 18:12
1
answer

Error in SELECT with BETWEEN between a range of dates

My problem is this, I am trying to show a table with the people who must cancel in the month of January or any month, I do it in the following way: First step in a link the initial data via GET <a href="calendario.php?dato=<?php echo...
asked by 08.01.2018 / 02:45
1
answer

Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result, boolean given in: [duplicate]

I get the following error:    Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result,   boolean given in C: \ Program Files   (x86) \ VertrigoServ \ www \ sdp \ search.php on line 25 <?php function nombreofcyciu(...
asked by 12.02.2018 / 17:20
2
answers

Pass a String obtained from a database to the src of an image

I would like to know if there is any way to pass a data String obtained from a database to reference an image, here the example: <div class="row"> <div class="col-md-7"> <a href="#"> <i...
asked by 01.12.2017 / 07:25