I'm implementing a memcache to cache mysql query results.
It loops thru the mysql results using
while($rowP3= mysql_fetch_array($result3)) {
or it loops thru the memcached results (if they are saved in memcache, and not expired) via
foreach($cch_active_users_final as $rowP3) {
This is probably something thats really obvious... but Im not getting it.
How can I get it to show the right looping method based on if the memcached value exists or not. I just want it to pick the right looping method. I could just duplicate the entire while { } function with all its contents, but I dont wanna repeat that huge chunk of code, just so I can change while to foreach
Any tips?