My code works fine in localhost
$ts = array('Transcription','Translation');
$ac = array('Accounting');
$it = array('S/W Development');
$qry = mysqli_query($db_handle,"SELECT GROUP_CONCAT(DISTINCT services SEPARATOR ',') FROM vendordata"); // select query
$data = mysqli_fetch_array($qry);
$services=$data;
$option = explode(',',$services[0]);
if(array_intersect($option, $hr)==true && $department=='HR & Admin'){
$query = "SELECT * FROM `vendordata` WHERE `approved`='Approved' AND services REGEXP 'Maintenance|Entertainment|Meals'";
}
elseif(array_intersect($option, $ts)==true && $department=='Transcription'){
$query = "SELECT * FROM `vendordata` WHERE `approved`='Approved' AND services REGEXP 'Transcription|Translation'";
}
elseif(array_intersect($option, $ac)==true && $department=='Accounts & Finance'){
$query = "SELECT * FROM `vendordata` WHERE `approved`='Approved' AND services REGEXP 'Accounting'";
}
elseif(array_intersect($option, $it)==true && $department=='IT'){
$query = "SELECT * FROM `vendordata` WHERE `approved`='Approved' AND services REGEXP 'S/W Development'";
}
else{
$query = "SELECT * FROM vendordata WHERE approved='Approved'";
}
I have to display records in table login users department. in localhost works fine. at live server it goes in else part.
Thank you in advance
source https://stackoverflow.com/questions/70128499/array-intersect-php-error-in-live-server-localhost-works-fine
Comments
Post a Comment