Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy my array value not able to retrieve and isset doesn't work for me
    primarykey
    data
    text
    <p>I'm trying to create a dynamic searching function but there is a problem I am not able to solve.</p> <p>What's wrong with the following code?</p> <p>JSON:</p> <pre><code>... $result=$obj-&gt;Decode_Serialize($resource);// method to unserialize string value $text= isset($result['text_department_code']) ? $result['text_department_code']: 'a'; if(!empty($search) &amp;&amp; !empty( $checkbox) &amp;&amp; !empty($match) &amp;&amp; !empty($sort) &amp;&amp; !empty($text)) { echo $text= $result['text_department_code']; // error Notice: Undefined index: text_department_code in line 18 print $text; print_r($result); } ... </code></pre> <p>I don't know why its just simply not work even isset have been included. //$result['text_department_code']; </p> <pre><code>print_r($result) output: Array ( [search_deparment_code] =&gt; department_code [checkbox_deparment_code] =&gt; true [match_deparment_code] =&gt; all [sort_deparment_code] =&gt; ASC [text_deparment_code] =&gt; aa ) </code></pre> <p>//Jquery passing serialize string to ajax</p> <pre><code>function getInstantSearchResult(){ $('#keypress').keyup(function(){ var Post_String = $('#forma').serialize(); // ajax_get_data(1,st); //alert(Post_String); $.ajax({ type : 'POST', url : 'jsonAjaxFinder.php', data : {Query_String:Post_String}, success : function(value){ alert(value); ajax_get_data(1); } }); }); } function ajax_get_data(page){ var businessUnitRequest; if (window.XMLHttpRequest) { businessUnitRequest=new XMLHttpRequest(); } else { businessUnitRequest=new ActiveXObject("Microsoft.XMLHTTP"); } var frame = document.getElementById("frame"); frame.style.left='20px'; var paginations = document.getElementById("pagination"); businessUnitRequest.open("POST", "jsonAjaxFinder.php", true); businessUnitRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded"); businessUnitRequest.onreadystatechange = function (){ if((businessUnitRequest.readyState == 4) &amp;&amp; (businessUnitRequest.status=200)) { frame = document.getElementById("frame"); var leng= frame.rows.length; for (z = leng - 1; z &gt; 0; z--){ frame.deleteRow(z); } var d = JSON.parse(businessUnitRequest.responseText); for(var o in d){ var row = frame.insertRow(1); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); cell1.style.paddingLeft='15%'; cell2.style.paddingLeft='1%'; cell1.innerHTML= d[o].department_code; cell2.innerHTML= d[o].description; } } } businessUnitRequest.send('no_page='+parseInt(page)); //+'&amp;serialize='+ serialize businessUnitRequest.innerHTML="requesting...."; } </code></pre> <p>Can someone explain to me my problem because i don't know how to solve it? that</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload