Hi,
I just start using CC to edit datas from a table. Those datas will diplays in a page that can be reached by 2 ways :
- from a research on 2 parameters,
- directly from an menu item and show all datas.
no problem with the 1st way, it work fine. But with the second way, the first call of the page displays no data because the 2 parameters have no value.
How can I do
Thanks in advance
I just start using CC to edit datas from a table. Those datas will diplays in a page that can be reached by 2 ways :
- from a research on 2 parameters,
- directly from an menu item and show all datas.
no problem with the 1st way, it work fine. But with the second way, the first call of the page displays no data because the 2 parameters have no value.
How can I do
Thanks in advance
Hi GreyHead,
Must I use session variable ?
How can I see my query ?
Thanks in advance
Must I use session variable ?
How can I see my query ?
Thanks in advance
Hi caroline,
I imagine that you can just get the $_GET variables from the URL but it's hard to tell without more specific information.
What URL are you using to make the link?
Bo
I imagine that you can just get the $_GET variables from the URL but it's hard to tell without more specific information.
What URL are you using to make the link?
Bo
Hi GrayHead,
Here is a description of the 2 pages :
1) The search page use 2 dropdown lists : Competences an Regions. Those parameters are POST variables. The query in CC is :
WHERE (Competence1 = '{PARAM_RefCompetence}' or Competence2 = '{PARAM_RefCompetence}' or Competence3 = '{PARAM_RefCompetence}' or '{PARAM_RefCompetence}' = 'ALL') and (SigleRegion = '{PARAM_SigleRegion}' or '{PARAM_SigleRegion}' = 'ALL')
This query works well.
2) a page call directly from an menu item and showing all datas
I try in vain modify the query to create a php paramatrized query in order to get all datas. Can you help me ?
Here is a description of the 2 pages :
1) The search page use 2 dropdown lists : Competences an Regions. Those parameters are POST variables. The query in CC is :
WHERE (Competence1 = '{PARAM_RefCompetence}' or Competence2 = '{PARAM_RefCompetence}' or Competence3 = '{PARAM_RefCompetence}' or '{PARAM_RefCompetence}' = 'ALL') and (SigleRegion = '{PARAM_SigleRegion}' or '{PARAM_SigleRegion}' = 'ALL')
This query works well.
2) a page call directly from an menu item and showing all datas
I try in vain modify the query to create a php paramatrized query in order to get all datas. Can you help me ?
Hi caroline,
Can you use an External URL link for the menu and add &search=all to the url. Then you could do this in the Where box:
Bob
Can you use an External URL link for the menu and add &search=all to the url. Then you could do this in the Where box:
<?php
$search = JRequest::getString('search', '', 'get');
if ( $search ) {
$where = '';
} else {
// drop-down search code here
}
?>Bob
thanks GrayHead,
The 2nd page (all datas, directly from menu) woks fine, even without &search=all in th url.
But the search by dropdown list Competences an Regions allways shows all datas.
Must I use GET variables instead of POST variables ?
thanks in advance
Caroline
The 2nd page (all datas, directly from menu) woks fine, even without &search=all in th url.
But the search by dropdown list Competences an Regions allways shows all datas.
Must I use GET variables instead of POST variables ?
thanks in advance
Caroline
Hi caroline,
Please post the code you are using in the Header & Where boxes. In general use GET for parameters in URLs and POST for parameters from forms.
Bob
Please post the code you are using in the Header & Where boxes. In general use GET for parameters in URLs and POST for parameters from forms.
Bob
Hi GreyHead,
here is my code
WHERE SQL:
Header:
POST Variables:PARAM_RefCompetence,PARAM_SigleRegion
URL from the menu item : index.php?option=com_chronoconnectivity
Thanks in advance
here is my code
WHERE SQL:
<?php
$search = JRequest::getString('search', '', 'get');
if ( $search ) {
$where = '';
} else {
// drop-down search code here
$where="WHERE (Competence1 ='{PARAM_RefCompetence}'or Competence2 = '{PARAM_RefCompetence}' or Competence3 = '{PARAM_RefCompetence}' or '{PARAM_RefCompetence}' = 'ALL') and (SigleRegion = '{PARAM_SigleRegion}' or '{PARAM_SigleRegion}' = 'ALL')";
}
?>
Header:
<?php
$_POST['PARAM_RefCompetence']='';
$_POST['SigleRegion']='';
?>
<table> ..... </table>POST Variables:PARAM_RefCompetence,PARAM_SigleRegion
URL from the menu item : index.php?option=com_chronoconnectivity
Thanks in advance
Hi caroline.
In a rush but there's a vital line missing at the end of the where box
Bob
In a rush but there's a vital line missing at the end of the where box
. . .
'{PARAM_SigleRegion}' = 'ALL')";
}
echo $where; // <-- add this line
?>Bob
thanks GreyHead, it works ... but my post variables are not reinitialized.
I have define default values in header code ($_POST['PARAM_RefCompetence']=''; $_POST['SigleRegion']='';).
Can you still help me ?
thanks in advance
caroline
I have define default values in header code ($_POST['PARAM_RefCompetence']=''; $_POST['SigleRegion']='';).
Can you still help me ?
thanks in advance
caroline
This topic is locked and no more replies can be posted.
