Click here to Skip to main content
15,909,445 members

Comments by Dipali Nigade (Top 9 by date)

Dipali Nigade 2-Apr-18 8:55am View    
hello sir i change the code but giveing warning
Warning: Illegal string offset 'first_name' in D:\wamp\www\core_php_demo\array_demo.php on line 25
Dipali Nigade 2-Apr-18 8:41am View    
yes i want to remove all key-values elements with first_name
Dipali Nigade 2-Apr-18 8:33am View    
yes sir i just improve that
Dipali Nigade 2-Apr-18 8:28am View    
no i want to remove first_name from array
Dipali Nigade 20-Nov-15 5:11am View    
i have abc.php with script and select tag.

<script>
$(document).ready(function() {
//alert("hiii");
$("select").change(function(){
// debugger;
var str=$("#addWIRES #cat_listdvr").val();
$.ajax({
url: 'getsubcat.php',
data: 'q='+str,
type: "GET",
success: function(menu)
{

debugger;
var option = '';
for (var i=0;i<menu.length;i++)
{
="" option="" +="<option value="" menu[i]="" '"="">' + abcd[i] + '</option>';
}
$("#addWIRES #sub_catdvr").append(option);
}
});
});
});
</script>
this is my script and below is my html code.
<label class="control-label" for="Category"> Category:</label>
<select id="cat_listdvr" class="input-medium" placeholder="Category" name="cat_dvr" autocomplete='off' />
<option value=''>Select Category </option> $y</option>";
}
?>
</select>
<label class="control-label" for="form-field-1">Sub Category:</label>
<select id="sub_catdvr" class="input-medium" placeholder="Sub Category" id='subidlistdvr' name="sub_catdvr" autocomplete='off' />
<option>Select Sub-Category</option>
</select>

After selecting category i want to display sub category in second select tag.

code on getsubcat.php is below
if($_REQUEST['q']!="0")
{
$val=$_REQUEST['q'];
$_SESSION['q']=$val;
$get_details_qry=mysql_query("select subcat_name from store_subcategory where smainC_id=(select smainC_id from store_maincategory where smainC_Name='$val')");
while($get_details=mysql_fetch_array($get_details_qry))
{
$value[]=$get_details['subcat_name'];
}
$arrvl=json_encode($value);
echo $arrvl;
}

i want to bind ajax respone from getsubcat.php select tag in abc.php as options