3
I have a function
pesquisaPagamentos($pesquisa)
I have a variable $pesquisa
which is receiving the following amount: '2015-10-05','2015-10-01'
, with single quotes.
It happens that the way this, when it arrives at the function
<?php
if(isset($_GET["acao"]) && $_GET["acao"] == "listaArr") {
$pesquisa = (isset($_POST["dataIni"])) ? "'".$PhpUtil->formataData($_POST["dataFim"])."','".$PhpUtil->formataData($_POST["dataIni"])."'" : "'',''";
print "<pre>";
print_r($pesquisa);
print "</pre>";
$arrecadacaoDia = $rel->pesquisaPagamentos($pesquisa);
I try to print the value of the first parameter and comes the integer value of the $query variable, ie: '2015-10-05','2015-10-01'
. The second parameter of the function receives an empty value.
Do separate: $pesquisa_data_inicio = "2015-01-02"; $pesquisa_data_final = "2015-02-02"; searchPayments($pesquisa_data_inicio, $pesquisa_data_final)
– Sr. André Baill
But in the call you passed the second argument? in the example of the question no.
– rray
See: if '2015-10-05','2015-10-01'. note that there is a comma in the middle. This is not enough for the variable to populate the 2 parameters when printed?
– Carlos Rocha
This is called the function?
$rel->pesquisaPagamentos($pesquisa);
? You only have one argument, you need two– rray
the function asks for 2 arguments, however, the value output of the $query variable emulates a string of type 'valor1', 'valor2' but I ended up doing according to your orientation. It became more legible! Thank you!
– Carlos Rocha