I consulted on the subject and I even managed to find some forms but nothing that could solve my case, I will try to be direct to facilitate. I have a table where some visits of some companies, I have the visits of the types RTV and ATV and I am adding the visits and putting in that table in the respective fields in the dates, each sum represents the visits made, in the example below the day 09/09 had 3 ATV visits.
EachvisitofthishasaID
,thatis,3IDs
andwhatI'mtryingtodoistojointheseID´s
tothesamevariable,Imadethenecessaryselectsandcreatedthisstructuretostorethem,butnotdynamically,I'mdoingthisselectwithinloop
andit'slikethat,inthecaseoftheATVvisit:
$sqlMontaLinkATV="SELECT supVisitaRtv.IdVisita FROM supVisitaRtv WHERE Tipo = 'ATV' AND supVisitaRtv.Data = ? AND IdEmpresa = ? ";
$arrayParamLinkATV = array($DataInc, $IdEmpresa);
$ResultadoLinkATV = $crud->getSQLGeneric($sqlMontaLinkATV, $arrayParamLinkATV, TRUE);
The result of this search I'm seeing thus with a print_r($ResultadoLinkATV)
:
Array ( [0] => stdClass Object ( [IdVisita] => 33 ) [1] => stdClass Object ( [IdVisita] => 34 ) [2] => stdClass Object ( [IdVisita] => 37 ) )
Where I have the IDs of the visits I need, I tried to insert them into a variable like this:
$IdVisita = array();
array_push($IdVisita, $ResultadoLinkATV[0]->IdVisita);
I hope I have been able to explain it satisfactorily.