How do I use REGEXP to fetch multiple data from the array
foreach ($list as $value) // this $list is from another array
$part = $value;
$vall = $value; // $list1 is an empty array
foreach($vall as $v)
$partnumber = "*.".$v.".*";
print_r(array_values($partnumber)); // these are some of the values Array (  => *.CGCG-0025-0.* ) Array (  => *.CGCG-0025-0.*  => *.CGCG-0025-0.* ) Array (  => *.CGCG-0025-0.*  => *.CGCG-0025-0.*  => *.CGCR-0003-0.* )
foreach($partnumber as $x)
echo '<br>'.$partnumber; // shows 'Array' on each lines
$fsql="select * from Error where RptDatime = 201706091000 and partnumber REGEXP '".implode("|",$partnumber)."'";
//example 1 $fsql="select * from MPdError where RptDatime = 201706091000 and partnumber = ('CGRQ-0057-0') ";
//example 1 shows the correct data but i need multiple partnumber
$getResults = $conn->prepare($fsql);
$results = $getResults->fetchAll(PDO::FETCH_BOTH);
foreach($results as $row)
$mac = $row['Machine'];
$id = $row['Id'];
echo '<br><br><br>ID:'.$id.'<br>Machine Number :'.$mac;
Though this may not be a good solution as it contains a huge security risk, I will still post it based on what is needed above.
REGEXP is not needed for data that are not complex in design.
$fsql = "select * from Error where RptDatime = 201706091000 and partnumber in ('" . implode("','", $vall) . "');"