Hello there, I’ve become so bored with this particular problem that has suffered me for two nights now, can anybody good please help me out, here is the problem: I have this table of spare part records displayed below in the database and I want it displayed exactly so on the web page but with the quantity column displaying red for parts less than or equal to 5 in quantity and the tyre parts(any description that has the word tyre in its name) show in red if less than or equal to 15. The table in the dbase is called ‘record_in’ and here is the code I used, but it doesn’t exactly give me what I want by either displaying every quantity in red or every quantity above 15 in red if I try further. Can somebody please correct me or give me another initiative out.
dbConnect();
$result1 = mysql_query("SELECT * FROM record_in WHERE description LIKE '%tyre%' AND quantity <= 15")
or die(mysql_error());
while ($row1 = mysql_fetch_array($result1)){
}
$sql = "SELECT * FROM record_in WHERE part_type LIKE 'FT-7NI Spares%' ORDER BY dateofsupply ASC";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_affected_rows()<1){
$msg = "<font color='red'>Sorry, No result Pls try again.</font>";
}else{
$sno = 0;
while($row = mysql_fetch_array($result)){
$sno++;
$part_n = $row['part_no'];
$describe = $row['description'];
$doq = $row['DOQ'];
$prt = $row['part_type'];
$loc = $row['location'];
$date = $row['dateofsupply'];
//if(($row1['quantity'] <= 15) || ($row['quantity']) <= 5){
//if(mysql_query("SELECT * FROM record_in WHERE description LIKE '%tyre%' AND quantity <= 15") || ($row['quantity']) <= 5))
if(($result1) || ($row['quantity'] < 6)){
$qty = "<font color='red'>".$row['quantity']."</font>";
}else{
$qty = $row['quantity'];
}
......
please find the file attached here to this message.