I have created one request table that contain all request information.
The table containing these columns:
requestid , itemrequest1, itemrequest2, itemrequest3, quantity1, quantity2, quantity3
How to make a relation so that if the itemrequest
has a value in column itemrequest2
, it will take the quantity from column quantity2
.
My query is like this:
$query2=mysql_query("select * from tbl_request WHERE unit='$unit' AND (itemrequest1='$itemrequest' or itemrequest2='$itemrequest' or itemrequest3='$itemrequest')");
$record_num=mysql_num_rows($query2);
while ($data1 = mysql_fetch_array($query2))
The problem is that when the $itemrequest
has a value in column itemrequest3
, the quantity will always show the quantity from column 1.