Hi…
I tried this code:
<?php
error_reporting(0);
date_default_timezone_set("Asia/Singapore"); //set the time zone
$con = mysql_connect('localhost', 'root','');
mysql_select_db("mes", $con);
if (!$con) {
echo 'failed';
die();
}
$sql = "SELECT PCODE, total FROM kanban_checker ORDER BY PCODE";
$res = mysql_query($sql, $con) or die(mysql_error());
while($row = mysql_fetch_assoc($res)){
$PCODE = $row['PCODE'];
$total = $row['total'];
}
$sql = "SELECT
P28, P28_max, P28_min,
P30, P30_max, P30_min,
P32, P32_max, P32_min,
P33, P33_max, P33_min,
P35, P35_max, P35_min,
P35M, P35M_max, P35M_min,
P35W, P35W_max, P35W_min,
P38, P38_max, P38_min,
P41, P41_max, P41_min,
P42, P42_max, P42_min,
P43, P43_max, P43_min,
P46, P46_max, P46_min
FROM parameter_settings";
$res_pcode = mysql_query($sql, $con);
$row = mysql_fetch_assoc($res_pcode);
$P28 = $row['P28'];
$P28_max = $row['P28_max'];
$P28_min = $row['P28_min'];
$P30 = $row['P30'];
$P30_max = $row['P30_max'];
$P30_min = $row['P30_min'];
$P32 = $row['P32'];
$P32_max = $row['P32_max'];
$P32_min = $row['P32_min'];
$P33 = $row['P33'];
$P33_max = $row['P33_max'];
$P33_min = $row['P33_min'];
$P35 = $row['P35'];
$P35_max = $row['P35_max'];
$P35_min = $row['P35_min'];
$P35M = $row['P35M'];
$P35M_max = $row['P35M_max'];
$P35M_min = $row['P35M_min'];
$P35W = $row['P35W'];
$P35W_max = $row['P35W_max'];
$P35W_min = $row['P35W_min'];
$P38 = $row['P38'];
$P38_max = $row['P38_max'];
$P38_min = $row['P38_min'];
$P41 = $row['P41'];
$P41_max = $row['P41_max'];
$P41_min = $row['P41_min'];
$P42 = $row['P42'];
$P42_max = $row['P42_max'];
$P42_min = $row['P42_min'];
$P43 = $row['P43'];
$P43_max = $row['P43_max'];
$P43_min = $row['P43_min'];
$P46 = $row['P46'];
$P46_max = $row['P46_max'];
$P46_min = $row['P46_min'];
$P47 = $row['P47'];
$P47_max = $row['P47_max'];
$P47_min = $row['P47_min'];
if($PCODE = $P28 || $total = $P28_min){
echo $P28_min;
}
elseif($PCODE = $P30 || $total = $P30_min){
echo $P30_min;
}
elseif($PCODE = $P32 || $total = $P32_min){
echo $P32_min;
}
elseif($PCODE = $P33 || $total = $P33_min){
echo $P33_min;
}
elseif($PCODE = $P35 || $total = $P35_min){
echo $P35_min;
}
elseif($PCODE = $P35M || $total = $P35M_min){
echo $P35M_min;
}
elseif($PCODE = $P35W || $total = $P35W_min){
echo $P35W_min;
}
elseif($PCODE = $P38 || $total = $P38_min){
echo $P38_min;
}
elseif($PCODE = $P41 || $total = $P41_min){
echo $P41_min;
}
elseif($PCODE = $P42 || $total = $P42_min){
echo $P42_min;
}
elseif($PCODE = $P43 || $total = $P43_min){
echo $P43_min;
}
elseif($PCODE = $P46 || $total = $P46_min){
echo $P46_min;
}
elseif($PCODE = $P47 || $total = $P47_min){
echo $P47_min;
}
else{
echo '';
}
?>
for display data if total = min.
The problem is, in this condition he satisfied if condition even though $total is not equal to $P28_min.
Thank you