Questions tagged as 'php'

7
answers

Change the format of the date I receive from YYYY-MM-DD to DD / MM / YYYY [duplicated]

I am a rookie, I have the following date: 2010-04-19 . I would like to convert this date to the format DD-MM-YYYY Example, my code. // "fecha" => $this->input->post(date("d/m/Y", strtotime('fecha')); $usuario = array( "n...
asked by 08.03.2017 / 17:01
3
answers

There is some way to load JavaScript before PHP

Before someone throws me around the neck I have to say that I know that PHP is loaded on the server and builds the page, that after this the client loads the resulting HTML with its JavaScript and its events. Having said...
asked by 26.06.2017 / 09:56
4
answers

Is it possible to validate before creating an object in PHP?

I have the following question: is it possible to validate the form of an array before creating an object? I have the following scenario. I am creating an apiRest and the programmer who consumes my API sends me a post with the following JSON:...
asked by 03.04.2018 / 16:42
2
answers

Correct way to use different databases in a web platform? [closed]

I am creating a web platform, which can be accessed by different workers' organizations. When a worker wants to enter the platform, he must select which organization he belongs to, then put his mail and password, as shown in the following ent...
asked by 16.11.2016 / 14:25
2
answers

Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in FILE on line 22

Why does it generate an error on line 22 if I compare it with other PHP and I have it right? On line 22 I have the following: while($rowHorEmp = mysql_fetch_array($resHorEmp)) And the variable $ resHorEmp comes from the following query:...
asked by 10.08.2017 / 23:42
3
answers

Show content of a variable in html from php

I'm new to php and I'm trying to show in a textbox the contents of a php variable but I do not get it, all the code is in the same file. <html> Number of places, time      <div id="contenedor"> <div id="logo" &g...
asked by 09.06.2017 / 16:48
2
answers

Help php receive two dates and show the end of the month in red

I need help with that exercise, it's a web application with php . It has to be POO Make an application that receives two dates and shows a list of the dates included in that range, showing the last day of each month of RED color. I'm do...
asked by 17.07.2018 / 17:16
3
answers

Browse JSON in PHP

I have a problem that I can not solve, I am still a novice in this. I receive in a php file the following JSON that I decode in this way. $resultado=json_decode($_POST["datos"]); and when I show the result variable it throws me down. {"n...
asked by 04.07.2018 / 09:17
2
answers

What are the models for Laravel 5.3 for?

Excuse my ignorance. I create the models in the following way: php artisan make:model Marcas -m And the model I leave it as it is created: namespace App; use Illuminate\Database\Eloquent\Model; class Marcas extends Model { // } I...
asked by 14.01.2017 / 22:32
3
answers

Warning message in PHP when not finding records

Good day, I have a page that searches for me in a table that I have in mysql, the question is .. If I do not find any record that I have to put code and where to get a notice like "No records found?" I enclose the code that performs the sea...
asked by 26.03.2018 / 20:00