Multiple grid with php mysql

Hi, I have mutiple grid on same page. How do I select from different table and load them in the right cells grid.

My HTML code:

[code]

/*these styles allows dhtmlxLayout to work in the Full Screen mode in different browsers correctly*/ html, body { width: 100%; height: 100%; margin: 0px; overflow: hidden; background-color:white; }
<script type="text/javascript">
  window.onload = function(){ 
      //Here you'll put code of your application
	  	dhtmlx.image_path='./codebase/imgs/';

dhtmlx.skin = 'dhx_terrace';
var main_layout = new dhtmlXLayoutObject(document.body, '1C', 'dhx_terrace');

var a = main_layout.cells('a');
a.setText('Envelope System Budget');
var accordion_1 = a.attachAccordion();
var panel_2 = accordion_1.addItem('panel_2','Budget');
var tabbar_2 = panel_2.attachTabbar();
tabbar_2.setImagePath('./codebase/skins/terrace_sky/imgs/');
tabbar_2.addTab('tab_3','Overview','');
var tab_3 = tabbar_2.cells('tab_3');
tabbar_2.setTabActive('tab_3');
var chart_1 = tab_3.attachChart({
	view: 'bar' ,
	label:'#sales#$',
	tooltip:{
		template:'#sales#'
	},
	radius:0,
	legend:{"template":"#year#","marker":{"type":"square","width":25,"height":15}},
	gradient: true,
	width:10,
	xAxis:{"title":"Envelopes","template":"#year#","step":"2"},
	value:'#sales#'
});

chart_1.load('./data/chart.xml', 'xml');



tabbar_2.addTab('tab_1','Transactions','');
var tab_1 = tabbar_2.cells('tab_1');
var toolbar_1 = tab_1.attachToolbar();
toolbar_1.setIconsPath('./codebase/imgs/');

toolbar_1.loadXMLString('<toolbar><item type="button" id="button_normal_1" text="Delete" img="" imgdis="" /><item type="button" id="button_normal_2" text="Add Income" /><item type="button" id="button_normal_3" text="Add Expense" /></toolbar>', function(){});
var grid_1 = tab_1.attachGrid();
grid_1.setIconsPath('./codebase/imgs/');

grid_1.setHeader(["Sel","Date","Payee","Amount","Category","Memo"]);
grid_1.setColTypes("ch,ro,ro,ro,ro,ro");

grid_1.enableResizing('true,true,true,true,true,true');
grid_1.setColSorting('str,str,str,str,str,str');
grid_1.init();
grid_1.loadXML("codebase/dhtmlxGrid/samples/04_dataprocessor/php/get.php");	//used just for demo purposes



tabbar_2.addTab('tab_5','Manage Envelopes','');
var tab_5 = tabbar_2.cells('tab_5');
var toolbar_2 = tab_5.attachToolbar();
toolbar_2.setIconsPath('./codebase/imgs/');

toolbar_2.loadXMLString('<toolbar><item type="button" id="button_normal_4" text="Delete" /><item type="separator" id="button_separator_1" /><item type="button" id="button_normal_5" text="Add Envelope" /></toolbar>', function(){});
var grid_2 = tab_5.attachGrid();
grid_2.setIconsPath('./codebase/imgs/');

grid_2.setHeader(["Column 1","Main Category","Envelope Name","Budgeted Amount","Default Percentage","Default Amount"]);
grid_2.setColTypes("ch,ro,ro,ro,ro,ro");

grid_2.setColSorting('str,str,str,str,str,str');
grid_2.setColWidth(0, '5');
grid_2.init();
grid_2.loadXML("codebase/dhtmlxGrid/samples/04_dataprocessor/php/get.php");	//used just for demo purposes

panel_2.open();

  }
</script>
[/code]

And my get.php

[code]<?php
error_reporting(E_ALL ^ E_NOTICE);

//include db connection settings
//change this setting according to your environment
require_once(’…/…/common/config.php’);
require_once(’…/…/common/config_dp.php’);

//include XML Header (as response will be in xml format)
header(“Content-type: text/xml”);
//encoding may be different in your case
echo(’<?xml version="1.0" encoding="utf-8"?>’);

//start output of data
echo ‘’;

//output data from DB as XML
$sql = “SELECT * from transactions”;
$res = mysql_query ($sql);

if($res){
while($row=mysql_fetch_array($res)){
//create xml tag for grid’s row
echo ("<row id=’".$row[‘id’]."’>");
print("");
print("");
//print("");
print("");
print("");
print("");
print("");
print("");
}
}else{
//error occurs
echo mysql_errno().": “.mysql_error().” at “.LINE.” line in “.FILE.” file
";
}

echo ‘’;

?>[/code]

tks for help
Seby

Sorry, but it is not clear, which effect you want to achieve
Please provide more details.

Well, I have 2 grids in 2 different tab wich I want to populate from different mysql source. and I don’t know how
tks
Seby

It doesn’t really differs from the case with one grid.
For each grid you need to have a separate php file with connector initialization for that grid.
And on clien side each grid will work with its own php file ( load command and dataprocessor )