Jump to content

Count return on if statement?


karimali831

Recommended Posts

Is it possible to count how many returns there are on a if statement?

 

Where you can see

echo 'yes'; 

 

it will echo this twice according to my condition, all I want is the the value 2 that it has returned twice... ?

 

              while($row = mysql_fetch_array($bookings))
              {            
                  if(time() > $row['returnby'] && $row['returned']==0)
                  {
                      $books_overdue = count($row['returned']);                  
                  }
                  if(time() > $row['returnby'] && $row['returned']==1)
                  {
                      $returned_ontime = count($row['returned']);                  
                  }

                  if(time() <= $row['returnby'])
                  {
                    echo 'yes';                      
                  }                
              }

 

thanks for help.

Link to comment
Share on other sites

Is it possible to count how many returns there are on a if statement?

Not sure what you mean by this?  Count the results from the query?  How many IF conditions are true?

 

all I want is the the value 2 that it has returned twice... ?

This makes no sense to me.  Please elaborate.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.