Folks I am trying to create my first grid using postgres. I am getting the following error.
PHP Fatal error: Call to a member function setcharset() on a non-object in /web/KoolPHPSuite/KoolControls/KoolGrid/koolgrid.php on line 1
I did not order the source code, just the code. It looks like it wants me to set the charset, but I find nothing on this in the doc pages.
Any help would be great.
Thanks
Here is my code.
<?php
//Step 1: Register KoolGrid component to your page
require "../KoolPHPSuite/KoolControls/KoolGrid/koolgrid.php";
require "../KoolPHPSuite/KoolControls/KoolAjax/koolajax.php";
require "../KoolPHPSuite/KoolControls/KoolGrid/ext/datasources/PostgreSQLDataSource.php";
$koolajax->scriptFolder = "../KoolPHPSuite/KoolControls/KoolAjax";
//Step 2: Create datasource
$host = '192.168.56.73';
$db = 'pbs';
$user = 'postgres';
$pass = 'postgres';
$dsn = "host=$host;port=5432;dbname=$db;user=$user;password=$pass";
$db_con = pg_connect("host=$host port=5432 dbname=$db user=$user password=$pass");
$ds = new PostgreSQLDataSource( $db_con );
$ds->SelectCommand = "Select * from event";
//Step 3: Init KoolGrid and settings
$grid = new KoolGrid("grid");
$grid->scriptFolder = "/KoolPHPSuiteKoolControls/KoolGrid";
$grid->styleFolder="default";
$grid->DataSource = $db_con;
$grid->AjaxEnabled = true;
$grid->Width = "655px";
$grid->AllowInserting = true;
$grid->AllowSorting = true;
$grid->AutoGenerateColumns = true;
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
//Step 4: Process Grid
$grid->Process();
?>
<html>
<head>
<title></title>
<?php echo $koolajax->Render();?>
</head>
<body>
<form id="form1" method="post">
<!-- Step 5: Get KoolGrid render -->
<?php echo $grid->Render();?>
</form>
</body>
</html>
~
~