Questions tagged as 'php'

2
answers

How to do integrity validation when trying to save duplicate data to the database?

Context: When attempting to register the Structure Checklist object, the following error occurred: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-5' for key 'un_checklist_estrutura' (SQL: insert into che...
asked by 28.08.2018 / 16:59
1
answer

Scale of services by turns in php

I plan to create a monthly shift schedule. I have 4 turns: T.M = Morning shift (11 helpers this shift, but each day    3) T.T = Afternoon shift (there are 5 aids this shift, but each day       2) T.I = Intermediate Shift (there are...
asked by 26.10.2018 / 10:02
1
answer

Error changing server hosting - Laravel PHP

When switching hosting servers, the application has the following error.        
asked by 15.10.2018 / 15:48
1
answer

How to change multiple records in a sql table at once?

Imagine a result of an SQL: ID - NOME- MENSAGEM 1 / israel / msg-olamundo 2 / rafael / msg-olamundo 3 / augusto / msg-olamundo Now I want to do in SQL the same thing that str_replace would do in php to pull all records from one x to the wo...
asked by 20.08.2014 / 17:06
1
answer

How can I find the chats ID for the Telegram API?

I'm setting up the Telegram BOT API via Guzzle. I'm trying to understand what the chat_id parameter would be described in the sendMessage method documentation . I have the following code: $cli = new \GuzzleHttp\Client([ '...
asked by 14.09.2018 / 18:35
1
answer

Capturing part of the string between certain characters repeated N times

I have a string that has the format of routes: /foo/ /{bar}/ /foo/{bar} /{foo}/{bar} /{foo}/bar/ Can have many values between slashes, values between {} are variable I wanted to catch all occurrences of {qualquercoisa} of t...
asked by 13.09.2018 / 15:52
1
answer

Add all the results of a table and separate by day / month

I have a table, where I would like to add all the results and separate them by Day / Month. 01/Abril = 3 Resultados; 03/Abril = 5 Resultados; 02/Maio = 1 Resultado; The table I'm using. **ID -- item_data** 01 || 2018-...
asked by 12.04.2018 / 03:31
2
answers

How do I display all 60 numbers

How do I display all 60 numbers? Already random, but only a number. <?php class CodeGen { private $codes = array(); public function __construct($codes) { $this->codes = $codes; } public function getRandomCode...
asked by 02.03.2018 / 18:27
1
answer

AngularJS with Socket.io and MySQL data

The following query in cidade.php looks up how many requests are open in a particular city, which blocks a link. If it is 0 , the sum of query frees the link. If it is greater than 1 it blocks the link. Angular Control...
asked by 25.10.2014 / 17:39
1
answer

Remove indices from array

How to remove indexes from an array? Original Array ["Torrada" => 4,"Cachorro quente" => 1] for [4,1]     
asked by 16.06.2018 / 04:56