After lots of searching and failing after trying.. i am posting this question here..
After half part of my actual query [here][1] i am not able to save the resulting array of arrays to the database..
Initially i had an array of inputs which i turned into array of arrays of inputs now my save function looks something like this
function store()
{
foreach($post['cats'] as $cat) {
$query = 'insert into #__joomd_item_cat values('.$cat.', '.$row->id.')';
$this->_db->setQuery( $query );
if(!$this->_db->query()) {
$obj->error = $this->_db->getErrorMsg();
return $obj;
}
}
}
now, how do i modify it to get my array of arrays into database..
This function is triggered by a serialized method.. so please recheck your answers and comments
function save(task) {
var data = $jd("form[name='<?php echo $array['editform']; ?>']").serializeArray();
$jd.ajax({
url: "<?php echo $url; ?>",
type: "POST",
dataType:"json",
data: data,
beforeSend: function() {
$jd(".poploadingbox").show();
},
complete: function() {
$jd(".poploadingbox").hide();
},
success: function(res) {
savesuccess(res);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus);
}
});
}
[1]: http://stackoverflow.com/questions/11583375/add-input-fields-dynamically-but-fields-are-generated-by-external-php-functions/11583597#11583597