Hi All,
i have this problem:
i'm opening a form passed data POST the string [azienda] (is a number code, on this case: 406)
I'm trying to create a Json code for Autocompleter with this data but it doesn't work.
If i print DATAPOST on a form, works fine, but in Json not.
This is my Json code for autocompleter:
Any ideas?
i have this problem:
i'm opening a form passed data POST the string [azienda] (is a number code, on this case: 406)
I'm trying to create a Json code for Autocompleter with this data but it doesn't work.
If i print DATAPOST on a form, works fine, but in Json not.
This is my Json code for autocompleter:
<?php $cod_azie = $_POST['azienda']; $db = JFactory::getDbo(); $db->setQuery("SELECT * FROM xcsri_ana_intranet WHERE cod_azie = $cod_azie "); $results = $db->loadObjectList(); foreach($results as $result ){ if(!empty($form->data['tag']) AND stripos($result->nominativo, $form->data['tag']) === false){ continue; } $json[] = array('id' => $result->id, 'text' => $result->nominativo); } echo json_encode($json);
Any ideas?