Datagrids, delayed loop of sorts

From: Date: Thu, 13 Jul 2006 15:45:49 +0000
Subject: Datagrids, delayed loop of sorts
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24642@lists.php.net to get a copy of this message
What I want to do is create a "delayed" loop of sorts, that allows me to print out the previous record, the current record, and the next record. I use this to allow a user to move records up or down etc. Sample code below: while( $nextRow = $res->fetchRow() ) { if( isset( $curRow) ) { Echo "<p>"; echo "Prev: ".$lastRow['id']; echo "Current: ".$curRow['id']; echo "Next: ".$nextRow['id']; echo "</p>"; } $lastRow = $curRow; $curRow = $nextRow; } Echo "<p>"; echo "Prev: ".$lastRow['id']; echo "Current: ".$curRow['id']; echo "</p>"; I was wondering if something like this was efficient to do with datagrids. I was thinking that perhaps instead of binding a whole resource to datagrid, I could add each row individually. Is it worth figuring out how to do this with datagrids, or am I using a hammer to put in a screw?? Thanks, Mark ----------------------------------------- Mark Steudel NetRiver Web and Application Developer 555 Dayton St. Suite A Edmonds, WA 98020 w: http://www.netriver.net p: 425.741.7014

« previous php.pear.general (#24642) next »