Questions tagged as 'php'

2
answers

Localhost says 'undefined'

This is my back end, which seeks to update the user's nickname <?php session_start (); include_once 'conexion.php'; $respuesta = array(); if( empty($_REQUEST['nick-nuevo'])) { $respuesta['mensaje'] = 'Nuevo nick, vacio'; } else {...
asked by 24.08.2018 / 16:20
1
answer

Escaping PHP quotes

I'm doing a insert in sql and I needed to change the single quotes, because for example a name O'Connor breaks the structure. I've tried putting: str_replace("'", "\'", $cadena); Also with: htmlspecialchars($contenido->te...
asked by 01.10.2018 / 16:18
4
answers

Insert two records

I have a problem, adding a record saves it in duplicate in the following way: actualPorcentaje 10 | marcaid 0 actualPorcentaje 0 | marcaid 4 This form allows me to update the prices through a percentage, after selecting a brand. <form...
asked by 18.10.2016 / 01:03
1
answer

how can I get the error code in a try catch in laravel?

I have a "create" method public function crear(Request $req) { $rules = array( 'nombre' => 'required', ); $validator = Validator::make ( Input::all (), $rules ); if ($validator->fails()){ return Response::...
asked by 01.11.2016 / 18:58
1
answer

Integrate Laravel 5 Apache in linux

Good I am trying to integrate laravel and apache but the routes are not recognized by the Apache. Well I show the configuration that I have in the virtutalHost of apache2 I have <VirtualHost *:80> #Alias /loginseg /var/www/html/...
asked by 20.05.2017 / 22:50
3
answers

PHP: "Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" What do you mean?

When a notice occurs, the code may work, but it may not show what we expect. I think these are the three types of news that we can have most often in PHP.    Notice: Undefined variable    Notice: Undefined index    Notice: Un...
asked by 16.06.2017 / 13:36
2
answers

JOINS with chains delimited by commas

I have a table called USERS, which has an index of certain nationalities as a string delimited by commas. ID | NOMBRE | NACIONALIDAD 1 | JUAN | 1,2,3 2 | PEDRO | 1,2 3 | JOSE | 1,3 I have my table of NATIONALITIES ID | NACION 1 |...
asked by 02.07.2018 / 22:01
1
answer

in PHP get the 25th day of the previous month

Month I would like to be able to select in my query the 25th day of the month before the present, regardless of whether we are at 2 or 27 in the current month, for example something like: Today's day 07/27/2018 <?=$date; ?> Result o...
asked by 27.07.2018 / 23:55
2
answers

Error executing prepared query

$user = $_COOKIE['c_username']; $filter = filter_var($_POST['buscar_inventario'], FILTER_SANITIZE_STRING); $query = "SELECT Inv_Id, Inv_Ref, Inv_Name,...
asked by 26.09.2017 / 10:47
4
answers

Show the first element of an array

I have a problem with an 'array, it has the following format: $array = [{"id": 1,"nombre": "Disco Duro"}]; I currently consume it in the following way $array[0] accessing the position of the array but what I try is to use the $arr...
asked by 05.08.2018 / 03:38