Questions tagged as 'php'

2
answers

how can I do to return a query grouping by the table name using pdo, php and mysql?

How can I do to return a query grouping by the name of the table using pdo, php and mysql? For example I want to make a query and return a json equal to this one, using pdo, how? { "nome da tabela ": [{ "nome da coluna": "225",...
asked by 21.11.2016 / 12:27
1
answer

How to define the semantics of packages downloaded with composer?

I created some PHP packages with composer help as a dependency manager and made it available in Packagist ( link ). p> After uploading the packages, I installed them inside a Laravel project. For this I used the following statement: compose...
asked by 16.11.2016 / 23:18
2
answers

SQLSTATE [23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

When I try to INSERT my table with PDO, I get the following error: SQLSTATE [23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' I've done a lot of research and saw some similar problems, but all for lack of AUT...
asked by 21.11.2016 / 17:00
1
answer

How to feed notifications in real time as a logged in user?

I'm wanting a system that keeps updating the logged in user to go showing the messages he receives. Taking into account that this system will have 250-500 concurrent users there, what is the best way to search the data in the database and update...
asked by 24.11.2016 / 18:05
1
answer

Interval in minutes of a period

I'm trying to make a select that lists in a range of 10 minutes a value of the bank, is there any way to show the data even though it does not have data in the range correctly? Example :    00:00:00 = 0      ...
asked by 21.11.2016 / 14:45
2
answers

Does using traits replace the role of multiple inheritance?

What happens if I use two different traits in a class, and both have a method with the same name, but different implementations in this method?     
asked by 05.10.2016 / 20:30
1
answer

PHP and mysql hours count

Good evening, I'm new here. One question I think is basic. I will create an "application" with PHP and mysql where I control the working hours of each collaborator with daily inputs and outputs. The doubt is the SQL just stores the data...
asked by 31.07.2016 / 05:43
2
answers

session lasting 30 minutes

I have a login system in PHP. I save the user's login and password in a session. Start it as follows: // Inicia a sessão session_start(); My question and how to do this session has a duration of 30 minutes, ie if the user leaves the page...
asked by 06.10.2016 / 16:07
2
answers

Validate captcha before sending form

I need a very simple captcha, but it can be validated before the form is sent, how can I do that? I currently use this: index.html <form method="post" action="valida.php" id="form" name="form"> <!-- campos --> <d...
asked by 15.08.2016 / 22:22
1
answer

Add Change Author in Type Post Quick Edit

I created a type post to customize the admin of a client's wordpress, everything works perfectly, however the option to change the author of the post in "quick editing" does not appear, I know that by default it will not show for fields custom,...
asked by 11.10.2016 / 07:32