query($sql); if ($resql && $db->num_rows($resql) > 0) { $options = array(); $cpt=0; while ($obj = $db->fetch_object($resql)){ $options[$obj->rowid] = $obj->ref.' - '.$obj->label; $cpt++; } print json_encode($options); } break; }