Below is my PHP MySQL Query and getting the last value result, I want to add 10 Javascript functions into my PHP page at end of page, however counting of variable works but I am not able to concat that value to function and other variable names.
Below is my code:
<script>
<?php
$brSql = "SELECT BRANCH_ID FROM `tb_um_client_branches` ORDER BY BRANCH_ID DESC LIMIT 1";
$brRset = mysql_query($brSql) or die('BRANCH LAST ID QUERY FAIL: '.mysql_error());
$brRID = mysql_fetch_row($brRset);
for($i = 0; $i < 10; $i++){
?>
cnter = (<?php echo $brRID[0]; ?> + <?php echo $i; ?>)
function getChecked_+cnter(){
var nodes+cnter = $('#tt_+cnter').tree('getChecked');
//var nodes = $('#tt').tree(data-options="method:'get',animate:true,checkbox:true");
var s_+cnter = '';
for(var i_+cnter=0; i_+cnter<nodes_+cnter.length; i_+cnter++){
if (s_+cnter != '') s_+cnter += ',';
s_+cnter += nodes_+cnter[i_+cnter].id + ' ' + nodes_+cnter[i_+cnter].text;
}
//$('#OLD_BRANCH_FILTERS_+cnter').value = s_+cnter;
$('#OLD_BRANCH_FILTERS_'+cnter).attr('value', s_+cnter);
//alert(s_+cnter);
}
console.log(cnter);
<?php
}
?>
</script>
Below is error, I am getting:
SyntaxError: missing ( before formal parameters
function getChecked_[cnter](){
Earliest help will be appreciated.
Thanks in advance !