Mysqli_query is not working inside array_map function. My code is :
define('DB_SERVER','localhost');
define('DB_USERNAME','xxx');
define('DB_PASSWORD','yyy');
define('DB_NAME','fff');
$conn = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_NAME);
foreach($unique_array as $supplier)
{
$urep[]=$supplier['rep_name'];
$udate[]=$supplier['date'];
$ucid[]=$supplier['cid'];
$unique_arrayyy[] = array('rep_name'=>$supplier['rep_name'], 'date'=>$supplier['date']);
}
array_map(function ($var) {
$fetch_gdd=mysqli_query($conn,"select * from grade");
echo mysqli_num_rows($fetch_gdd); exit;
}, $unique_arrayyy);
The $unique_arrayyy includes multidimentional array values. I want to run query inside the array_map fuction. At the time of fetching the row its giving me blank window. Please help.
error_reporting(E_ALL); ini_set('display_errors',1);on top of page just after<?phpad also change like:-$fetch_gdd=mysqli_query($conn,"select * from grade")or die (mysqli_error($conn));