The above only echos out the $reqno if the item number is 1.
The problem I've got is another page has the following select.
$reqquery = "SELECT * FROM `porders` WHERE `username` = '$username' AND `type` = 'request' AND `status` = 'rejected' "; $userreqs = mysql_query($reqquery) or die(mysql_error());
And because I've stipulated rejected and some rejected reqs are not item 1 it doesn't echo out the $reqno.
Its like I need to say: if $reqno = $reqno echo reqno on lowest item number.
I've been thinking down the following angles but I can't get anything to work. // if item 1 is present echo $reqno. // if item 2 is present echo $reqno else echo $reqno on lowest item number. // if item 3 is present echo $reqno else echo $reqno on lowest item number.
Thanks for the reply and I apologise for my first explanation, I was struggling to document it clearly.
Your example does work and echos out the $reqno against the appropriate item no if I change echo $item, to echo $reqno; but that's my problem.
I only want it to echo the $reqno once per 3 items displayed. If all 3 items are rejected I want it to echo the $reqno once and at item 1. If item 1 was pending I need it to display item 2 and item 3 with the $reqno being displayed at item 2 only and item 3 blank.
Initially when a req is raised it can have 1 item, 2 or 3. When I insert it I create a row for each item in the db with the same req number. It looks like: