Questions tagged as 'php'

1
answer

what does a ratio of 1 to many mean? [closed]

I have a question. in the design of a database, in the entity-relation part, which means or for what it is worth saying that it is a relation of 1: M M: 1 N: M     
asked by 27.05.2018 / 05:43
2
answers

@foreach in laravel that goes from 2 objects to 2 objects?

I am building a blog in laravel but I found a problem in my blog template, from the file of routes I send by compact the variable post: Route::get('/blog', function () { $posts = App\Post::latest('published_at')->get(); return view(...
asked by 12.08.2018 / 06:07
2
answers

how to make an INSERT of several countries

This situation has never occurred to me but there is always a first time. The thing is that I have a field type select and I need to fill it with a list of countries, I already have the list but I have no idea how to do INSERT of this...
asked by 16.09.2018 / 01:26
2
answers

Delete select option without intervening a div

I have this code in PHP that repeats me 10 times the same select with the same information. for ($i=1; $i < 11; $i++) { $output.=' <div class="form-group"> <label>Prioridad '.$i.' de horario</label>...
asked by 08.07.2017 / 20:56
2
answers

How to handle PHP file paths

Hello guys for a long time I wanted to introduce myself in the PHP world but I had never finished giving the pleasure, one of the issues I have is how to manage the routes of the include and require already if you have several folders to include...
asked by 29.07.2017 / 21:55
3
answers

Prevent a PHP file from being called directly from the browser

I have tried many methods, but in the end they always fail. The only one that did not give me problems was to do a validation with GET getting the id , if(!isset($_GET[id])){ { header('Location: /App'); } } but it does not ma...
asked by 17.08.2017 / 07:07
1
answer

Insert a date before the scheduled date

I have a table called deliveries, within it 2 fields fecha_preparar and fecha_entrega . $fecha_prepararse = fecha_entrega - 4 dias INSERT INTO entregas (fecha_entrega, fecha_preparar) VALUES ('$fecha_entrega', '$fecha_prepararse'...
asked by 02.09.2017 / 07:01
3
answers

Average hours PHP

I want to add and take an average of a few hours. $cadena = '00:09:00,00:09:00,00:09:00,00:09:00,00:09:00'; $arr = explode(",",$cadena); $total = strtotime('00:00:00'); for($i = 0; $i<count($arr);$i++) { $total = $total + strtotime($arr[...
asked by 14.02.2017 / 01:31
1
answer

Fatal error: Can not unset $ this PHP 7.1

I get the following error in PHP: Fatal error: Can not unset $ this that refers to this snippet of code: public function __destruct(){ unset($this); } That line I use to destroy an object, in previous versions of PHP it worked without...
asked by 07.11.2017 / 23:09
3
answers

Habblitar errors in PHP

I uninstalled XAMPP to install PHP in IIS but I realize that errors are not enabled. When a syntax error or some other type of code error occurs, the page does not notify you and simply sends an error 500. How can I enable errors in PHP? Be w...
asked by 02.08.2016 / 18:08