Questions tagged as 'php'

1
answer

Problem with pivot table in laravel 5.7

I am doing a project for the university and I have a problem working with a pivot table, it is the relationship between Vaccines (Vaccine) and Pets (Pet), it is a relationship of many to much, believe the migrations of both Vaccine and of Pet, a...
asked by 31.12.2018 / 20:43
2
answers

Consult multiple tables in Laravel 5.1

I have this query in which you are looking for products and the category to which they belong: $products = Product::product($product) ->category($category) ->with('category')...
asked by 04.01.2016 / 16:16
1
answer

Error in PHP sqlsrv_num_rows ()

I did a multicary program but with mysqli to do tests since they do not let me take information about the work, where you work with sql server and when passing the connection and other statements in the php to sql server I get this error:   ...
asked by 23.08.2016 / 22:01
1
answer

PHP is not displayed when generating PDF

I am trying to generate a pdf with data collected in a form with PHP. The library that I am using is mPDF <?php $cliente = $_POST['cliente']; $direccion = $_POST['direccion']; $telefono = $_POST['telefono']; require_once(...
asked by 26.09.2018 / 12:36
1
answer

Problem with $ _POST, $ _ GET ... with double dollar

I have this code to validate security: $tipos = array('$_POST','$_GET','$_COOKIE','$_SESSION','$_FILES'); foreach($tipos as $tipo){ if ( isset($$tipo) && !empty($$tipo) ) { foreach ($$tipo as $key => $item) {...
asked by 27.09.2018 / 16:55
1
answer

filter query with repeated values only show 1

Good morning I have this query $eventos_history_query = tep_db_query("select * from " . TABLE_HISTORIAL . " where numero_evento = '" . $customers['numero_evento'] . "' order by eventos"); while ($eventos_history = tep_db_fetch_array($ev...
asked by 04.10.2018 / 11:48
1
answer

Add data obtained mysqli to a multi array

I'm trying to add the data obtained from a select and order them to an array in PHP. I want to accommodate the array in this way: $array = array(noticias => array("1" => array ("titulo" => "Noticia 1", "autor" => "Pepe", "fecha"...
asked by 06.08.2018 / 23:38
2
answers

Convert a string from an array to an array type in PHP

In short, I have something like this: $variable = "[{"id":1, "nombre":"Juan"},{"id":2, "nombre":"Manuel"}]" As you can see, it's a string and I want to pass it to an array, the goal is to be something like: $variable = [ ['id' => 1...
asked by 24.06.2018 / 23:22
3
answers

How to apply style to an HTML table generated with PHP?

I have a php file that shows me data from a table (bd mysql), on the other hand, I have an HTML file where I have a table with CSS styles and everything working, I would like to apply these styles with the data extracted from the base data throu...
asked by 22.03.2018 / 19:43
1
answer

How to avoid having holidays

Hello, I have an application so that a user can take vacation days. I have a function that does not tell me neither weekend nor holidays. For example in Andalusia on March 29 is a holiday, if a user takes a vacation from March 28 to April 2, it...
asked by 23.03.2018 / 08:16