MX Looper Forum :: How can I to limit recordset in SQL string and apply Page Na

This thread was displayed: 290 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
chanyi lin
09-26-2006 10:33:31 GMT +2

Hello,

How can I to limit recordset in SQL string and apply Page Naviagation Bar behavior at the same time? It will show the message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LMIT 1 LIMIT 0, 10' at line 1

---

$maxRows_rsSmsSmseLogSendListing = 10;
$pageNum_rsSmsSmseLogSendListing = 0;
if (isset($_GET['pageNum_rsSmsSmseLogSendListing'])) {
  $pageNum_rsSmsSmseLogSendListing = $_GET['pageNum_rsSmsSmseLogSendListing'];
}
$startRow_rsSmsSmseLogSendListing = $pageNum_rsSmsSmseLogSendListing * $maxRows_rsSmsSmseLogSendListing;

$colname_rsSmsSmseLogSendListing = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsSmsSmseLogSendListing = (get_magic_quotes_gpc()) ? $_SESSION['kt_login_id'] : addslashes($_SESSION['kt_login_id']);
}
mysql_select_db($database_connSms, $connSms);
$query_rsSmsSmseLogSendListing = sprintf("SELECT * FROM sms_smse_log_send WHERE sms_acct_id = %s ORDER BY create_date DESC LMIT 1", GetSQLValueString($colname_rsSmsSmseLogSendListing, "text"));
$query_limit_rsSmsSmseLogSendListing = sprintf("%s LIMIT %d, %d", $query_rsSmsSmseLogSendListing, $startRow_rsSmsSmseLogSendListing, $maxRows_rsSmsSmseLogSendListing);
$rsSmsSmseLogSendListing = mysql_query($query_limit_rsSmsSmseLogSendListing, $connSms) or die(mysql_error());
$row_rsSmsSmseLogSendListing = mysql_fetch_assoc($rsSmsSmseLogSendListing);

Thank you.

Back | Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
09-26-2006 19:06:44 GMT +2

Hello,

If I understand correctly, you want to limit the records displayed on a page. If this is the case, then you must not add a LIMIT clause as another one will be added by the navigation code. You can simply modify the value of the variable 

$maxRows_rsSmsSmseLogSendListing

Regards,
Razvan RACASANU

Reply | Quote | Top
© Adobe Systems Romania. All rights reserved.