Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
This is my code..
require_once "koolreport\autoload.php";
use \koolreport\instant\Widget;
use \koolreport\inputs\Select2;
use \koolreport\KoolReport;
include 'connect.php';
$result = mysqli_query($conn,"SELECT * FROM add_stock");
$rowz=mysqli_fetch_array($result);
$res = array();
while($line = mysqli_fetch_assoc($result)){
$something['product_name'] = $line["product_name"];
$something['product_id'] = $line["product_id"];
array_push($res,$something);
}
Widget::create(Select2::class,array(
"multiple"=>true,
'name'=>"my_select2",
"placeholder"=>"Select customer",
"dataSource"=>$res,
"dataBind"=>array(
"text"=>"product_name",
"value"=>"product_id"
),
"attributes"=>array(
"class"=>"input",
"id"=>"input"
)
));
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo