Questions tagged as 'php'

2
answers

Laravel 5 create Table and Self-Referenced model (self Referencing)

How do I create a table autor referenced and how do I do the relationship in the same model?: Example: Tengo una tabla: Categoria Campos: categoria_id, nombre, categoria_padre It translates that a category (parent) can have many...
asked by 16.02.2018 / 05:35
1
answer

How to avoid showing error when using the $ _REQUEST method in php?

Well I explain, when loading my page.php from a local server it shows me the following error: Undefined index: var_entrada ... line 17.This is the code: <form action="pagina.php"> <p><input type="text" name="var_entrada" &g...
asked by 01.02.2018 / 23:22
1
answer

Problem filling in input with data from a select

I am trying to fill a input according to a data that I choose from a select , I do it using AJAX and PHP . This is my code: <select id="pro" name="plan" class="form-control"> <option readonly>Elegir Plan&...
asked by 16.02.2018 / 21:05
1
answer

Error when relating tables in laravel 5.5

Veran I want to do with laravel 3 tables: Plants, User and Comments. The story is that a user can write comments about the plants to ask or answer questions about the plant. Migration of the Plants table: <?php use Illuminate\Support\Fa...
asked by 10.02.2018 / 15:24
1
answer

Ask for data with prompt () and store it in mysql with php

I am working a sales system but when a product has a unique serial number I need you to show me a prompt () to write the serial number and then store it in a php variable and store it in mysql. This is my code: <?php if($tProducto == "...
asked by 25.03.2018 / 11:40
1
answer

How to show different messages when entering duplicate data to the database? Php / MySql

Hello! I am trying that, when the user enters the name of a region, if the same one is repeated it will be shown in the screen "An error occurred", but I can not. Region.php: class Region { private $regID; private $regNombre;...
asked by 24.03.2018 / 20:02
1
answer

Relate twig template with php controller in symfony

I have a method in the controller used to change data in a table. public function bajaServicioAction($idservicio, $idcliente) { codigo para hacer el cambio en la base de datos } On the other hand I have a template ficha.html.twig...
asked by 12.03.2018 / 17:59
2
answers

Problem redirecting laravel

I have a page where I store images in a project folder and the name of the image file I store in the DB. So all right, I can save and delete the images in the folder and at the same time delete the data stored in the database. My problem comes w...
asked by 26.03.2018 / 03:31
1
answer

How to upload image to the local server externally?

I have a problem trying to upload a photo to my local server, everything works fine if I use an action and refer to the folder where my php file is, but it's not what I need because it redirects me to an empty page, I need to redirect myself t...
asked by 05.04.2018 / 18:13
1
answer

Error in Laravel DateTime :: __ construct (): Failed to parse time string

Create a virtual host and when entering the URL, sometimes I open the laravel page and others throw me that DateTime error, how can I solve it? I found this: link I do the php artisan key: generate but nothing happens, what follows be...
asked by 12.03.2018 / 03:39