sry i don't understand what writen here let me repair ----- Original Message ----- From: "Gustav Wiberg" <gustav@xxxxxx> To: <php-windows@xxxxxxxxxxxxx> Sent: Tuesday, February 06, 2007 9:39 PM Subject: RE: [PHP-WIN] SSL on Windows Server 2003 Hi there guys! Do you know any way of getting NEXT row based on a specific ID in db? <?php $thisRow = $_GET["thisrow"]; $thisID = $_GET["thisID"]; //Get next row (With ID and sortorder-nr from db // $sql2 = "SELECT IDPrice, sortOrder FROM tbprices WHERE sortOrder>" . $db -> safeQuote($thisRow); $dbArray = $db -> makeArray($sql2); $dbNextSortOrder = $dbArray["sortOrder"]; $dbNextIDPrice = $dbArray["IDPrice"]; I can't have sortorder> (larger than) BECAUSE the sortorder don't have to be larger in the actual table. Of course, I can loop through a table but it doesn't seem so good programming practice ?> Best regards /Gustav Wiberg -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php <? $thisRow = $_GET["thisrow"]; $thisID = $_GET["thisID"]; //repir on this $sql2 = "SELECT IDPrice, sortOrder FROM tbprices WHERE sortOrder>" . $db -> safeQuote($thisRow)." AND IDPrice > $thisID ORDER BY `IDPrice` ASC LIMIT 0,1"; $dbArray = $db -> makeArray($sql2); $dbNextSortOrder = $dbArray["sortOrder"]; $dbNextIDPrice = $dbArray["IDPrice"]; ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php