Hello,
Don't know if CC bug or myself mistake :
This work in a chronoform (after submitting mail):
and give me :
But in CConnectivity I get stage not from POST but from context with {} so I change
But finely this fails et and retruns :
If I change "'.$nv_stage.'" with "some_const" this works !!!
I thought it was in query but
do you have some idea ?
thanks
PS : I use DB request in CConnectivity because I use data from another table that the connection use.
Don't know if CC bug or myself mistake :
This work in a chronoform (after submitting mail):
<?php
$db =& JFactory::getDBO();
$nv_stage=$_POST['stage'];
$requete_get_maquette = 'SELECT urgences,chu,med_adulte,pedia_gyneco FROM jos_liste_stage_hospit WHERE stage="'.$nv_stage.'"';
$db->setQuery($requete_get_maquette);
$liste = $db->loadObjectList();
$le_stage = $liste[0];
echo "urg : $le_stage->urgences ";
echo "ma : $le_stage->med_adulte ";
echo "chu : $le_stage->chu ";
echo "peda_gyneco : $le_stage->pedia_gyneco ";
?>and give me :
urg : 0 ma : 1 chu : 1 peda_gyneco : 0
But in CConnectivity I get stage not from POST but from context with {} so I change
$nv_stage=$_POST['stage']; with $nv_stage="{stage}";But finely this fails et and retruns :
urg : ma : chu : peda_gyneco :
If I change "'.$nv_stage.'" with "some_const" this works !!!
I thought it was in query but
echo $db->getQuery(); returns same thing for "'.$nv_stage.'" or "some_const" :SELECT urgences,chu,med_adulte,pedia_gyneco FROM jos_liste_stage_hospit WHERE stage="some const"
do you have some idea ?
thanks
PS : I use DB request in CConnectivity because I use data from another table that the connection use.
Hi,
that's because the code is evaluated (and so PHP is executed" before the replacement is done, instead use $row->stage
regards
Max
that's because the code is evaluated (and so PHP is executed" before the replacement is done, instead use $row->stage
regards
Max
first thank you for your answer.
Ichanged
but it doesn't change anything. Did you mean that ?
Ichanged
$nv_stage="{stage}"; with $nv_stage=$row->stage;but it doesn't change anything. Did you mean that ?
Hi, thank you, tha's what I mean yes, it will work only in the "body" box code, did you try this ?
Max
Max
come back from week-end and it works !!!
thanks lot your solution were the good one, don't known what I did last week ....
thanks lot your solution were the good one, don't known what I did last week ....
No problems!🙂
Max
Max
This topic is locked and no more replies can be posted.
