Questions tagged as 'php'

2
answers

Treat division by zero

I have the following function in PHP: public function teste() { $conta = "0/(0+0+0)"; eval('$result = (' . $conta . ');'); echo $result; } In this case, the formula (in the example 0 / (0 + 0 + 0) obviously returns error because...
asked by 21.02.2018 / 13:45
1
answer

How to create a cron in Laravel?

I have to create a Cron in Laravel to send emails every 24h. I must upload the email to the bank. So after a query in the database cron should send the email with the query data.     
asked by 24.10.2017 / 22:17
1
answer

How do I store multiple values in each "option" of a "select"?

I have a option and two inputs to feed according to the select result. In select the user is chosen and the address and email of the selected user are entered in the two inputs . I would like to know if it is possible to have 2 poss...
asked by 26.01.2018 / 22:45
2
answers

Paint table row when receiving specific data

I have this code: <?php foreach ($controller->Lista() as $objProg) { ?> <tr> <td><?php echo $objProg->getplaca(); ?></td> <td><?php echo $objProg->getmot(); ?></td&g...
asked by 04.02.2016 / 20:16
2
answers

Run PHP script in Windows Task Scheduler

I have a PHP script that I'm currently running with an open browser, with the command below: <meta HTTP-EQUIV="refresh" CONTENT="1800"> Despite the memory problems that the browser consumes, it was running smoothly. Now I need to deve...
asked by 19.05.2016 / 22:21
3
answers

use the PHP implode

I need to put the result in this way: valueA, valueB, valueC. I'm using the code below: $valor = "valorA"; $valor .= "valorB"; $valor .= "valorC"; $array = array($valor); echo implode(",",$array); Only using it that way, I can not. The va...
asked by 31.08.2015 / 19:41
4
answers

Data from a table A not contained in Table B

Following tables: Table: Users Id, Name Table: Card Id, UserID, Description I ask to know which users do not have a card: SELECT * FROM usuarios as u LEFT JOIN cartao as c ON c.IdUsuario != u.Id The result does not only ret...
asked by 13.07.2016 / 20:12
3
answers

How to get the highest numeric value supported by php?

Is there any method of php to get the highest number value supported by it?     
asked by 10.02.2017 / 01:11
3
answers

How to do SELECT on more than one database table?

I have two tables in the database: zip and users. Can I make a single query to get fields from the two tables? Both have idCep. I want to get the address data from the cep table and the name and user of the users table. As I'm working with ph...
asked by 25.04.2016 / 20:31
4
answers

Return a sum in different rows in mysql

I have a table of deposit statements and withdrawals from some clients, as follows: id_cliente|operação|valor | ----------+--------+------+ 51298 | 01 | 50,00| ----------+--------+------+ 51298 | 01 | 48,50| ----------+--------...
asked by 05.05.2016 / 22:50