I am playing around with the code generator for KoolGrid. I am a new to koolphp
The generated code gives me an error:
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead...
This is the generated code:
<?php
/*
* Please put this file in the same folder with KoolControls folder
* or you may modify path of require and scriptFolder to refer correctly
* to koolgrid.php and its folder.
*/
require "KoolControls/KoolGrid/koolgrid.php";
$db_con = mysql_connect("localhost","sakila","caroline");
mysql_select_db("sakila",$db_con);
$ds = new MySQLDataSource($db_con);
$ds->SelectCommand = "select actor_id, first_name, last_name from actor";
$ds->UpdateCommand = "update tblUsers set name='@name' where id='@id'";
$ds->InsertCommand = "insert into tblUsers(id,name) values('@id','@name')";
$ds->DeleteCommand = "delete from tblUsers where id=@id";
$grid = new KoolGrid("grid");
$grid->scriptFolder = "KoolControls/KoolGrid";
$grid->DataSource = $ds;
$column = new GridBoundColumn();
$column->DataField = "actor_id";
$grid->MasterTable->AddColumn($column);
$column = new GridBoundColumn();
$column->DataField = "last_name";
$grid->MasterTable->AddColumn($column);
$column = new GridBoundColumn();
$column->DataField = "first_name";
$grid->MasterTable->AddColumn($column);
$grid->Process();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>KoolGrid</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<?php echo $grid->Render(); ?>
</body>
</html>
Can anybody advice please?