Get KoolPHP UI with 30% OFF!

How to connect KoolGrid to a MySQL DataSource using MySQLI

Stephen Harmon
All of the KoolGrid Examples show how to connect to a MySQL Datasource using the OLD METHOD. However, if you are using the current stable MySQL and PHP (which I'm running under MAMP currently), the OLD METHOD (as follows) has been deprecated.
Here is the old method I speak of:
// Create Datasource
$conn = mysql_connect($host, $username, $password);
mysql_select_db($default_dbname, $db_conn);
$ds = new MySQLDataSource($db_conn);
However, the new method would be something like this. But with my lack of experience I can't seem to get this to work. I get the following PHP error but can't understand everything as the KoolGrid.php is obfuscated.
$conn = new mysqli($host, $username, $password, $db);
$ds = $conn;
Warning: mysql_set_charset() expects parameter 2 to be resource, object given in /KoolControls/KoolGrid/koolgrid.php on line 1
Warning: mysql_query() expects parameter 2 to be resource, object given in /KoolControls/KoolGrid/koolgrid.php on line 1
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in /KoolControls/KoolGrid/koolgrid.php on line 1
Posted Nov 3, 2015 Kool
Anthony Amolochitis
You can do the following to connect via MySqli
$Db = new mysqli( $DB_Credential->host , $DB_Credential->username , $DB_Credential->password ,"",$DB_Credential->port ) ;
..
.. some code here to build your grid as usual
..
// set the data source
$KoolGrid->DataSource = new MySQLiDataSource($Db );

The rest is the same.
Posted Nov 4, 2015 Kool
Stephen Harmon
OK, something is not quite right. Dumb this down a little for me...
Here is what I have:
<?php 
    $KoolControlsFolder = "KoolControls";
    require "KoolControls/KoolGrid/koolgrid.php";
    require "KoolControls/KoolAjax/koolajax.php";
    $koolajax->scriptFolder = "KoolControls/KoolAjax";
    
    // Database & Connection
	$host = "localhost";
	$username = "testUsername";
	$password = "testPassword";
	$db = "testDB";
	
	$conn = new mysqli($host, $username, $password, $db);
    $ds = new MySQLiDataSource($conn);
    
    $ds->SelectCommand = "select * from drivers";
    $grid = new KoolGrid("grid");
    $grid->scriptFolder = "KoolControls/KoolGrid";
    $grid->DataSource = $ds;

And I still get the following error:
[04-Nov-2015 15:19:22 America/Denver] PHP Fatal error: Class 'MySQLiDataSource' not found in /workspace/manage.php on line 9
Posted Nov 4, 2015 Kool -
Anthony Amolochitis
require the datasource
/KoolControls/KoolGrid/ext/datasources/MySQLiDataSource.php
Posted Nov 5, 2015 Kool -
Peter
Thanks Anthony for your answer :)
Posted Nov 5, 2015 Kool -
Daniel
Hey, I sometimes browse discussions about slot games because it’s a good way to discover new casino platforms. While reading one of those threads I found rolldorado casino mentioned by another user. I started with Wolf Gold but the early spins were mostly losses. I increased the stake slightly and switched to Starburst, and the bonus feature triggered with a satisfying payout. After that session this casino quickly became one of my regular places to play.
Posted Mar 11 Kool
Daniel
Hi, ik zat ’s avonds wat te scrollen op zoek naar iets ontspannends en kwam uit bij retrozino met voordelen voor spelers uit Nederland. Mijn eerste pogingen gingen niet goed en ik verloor meerdere keren, maar daarna besloot ik mijn aanpak te veranderen en iets meer risico te nemen, wat resulteerde in een goede winst. Dat gaf meteen meer motivatie en maakte het spelen een stuk interessanter, dus het is zeker iets om te bekijken.
Posted Apr 9 Kool
John
Honestly browsing forum threads for platform recommendations is exactly how I found my current setup too. Was going through a similar discovery phase maybe six months ago, jumping between different slots on random platforms trying to find something that felt right. Ended up reading a thread where someone mentioned Mostbet and almost scrolled past it. Downloaded the app https://mostbet-pak.pk/app/ that same evening mostly out of curiosity, started with low stakes on a Pragmatic title just to get a feel for how the platform behaved. First twenty minutes were pretty flat, nothing exciting happening, then switched to Sweet Bonanza purely on instinct and the free spins feature triggered within about fifteen minutes with a multiplier that made me sit up properly. What turned it from a one time test into my regular spot wasn't even that specific win though, it was withdrawing my session profit the same night and watching it land before midnight without a single follow up message.
Posted 5 days ago Kool