function centreagg($centre_name){
$centrevalues = array(0);
$sql = "select distinct(node) from master_table where centre_name='".$centre_name."')";
$node = array();
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
array_push($node,$row[0]);
}
$q=0;
foreach($node as $_)
{
$value = array(0);
$sql_net_perf = "select * from table1 where node = '".$_."' group by node";
//$sql_net_perf = "select count(*),cm.no_of_nodes,cm.total_nodes from nodes_details_cur nd, cluster_master cm where nd.head_node = cm.head_node and status = 0 and nd.head_node = '".$_."' group by nd.head_node";
$result = mysql_query($sql_net_perf);
while($row = mysql_fetch_array($result))
{
$value[0]=$row[1].'('.$row[0].')'.'('.$row[0].')';
}
$centrevalues[$node[$q++]]=$value;
}
return $centreaggregate;
}
$centreComputegridfs= updowntotal($center_name);
$node=array('master','cluster');
for($j=0;$j<count($centreComputegridfs);$j++){
$i=0;
foreach($head_node as $head){
print $centreComputegridfs[$head][$i];
}
$i++;
}
Hi,
I have a function which returns the values based on the centre_name.
When the count is greater than 1 the
for the master and cluster, it has to print like this.
print $centreComputegridfs['master'][0];
print $centreComputegridfs['cluster'][1];
At present it is printing when only nodde as master is selected it print's cluster node value also. How to avoid and print only based on head_node.