close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Order by error

Thread began 4/19/2011 12:38 am by nickj | Last modified 4/19/2011 9:54 am by nickj | 657 views | 1 replies

nickj

Order by error

In the cod below I tried to order by a column name which works but when I tried to make it work using a URL variable it fails to sort. The recordset works but the sort is ignored.

Why?

thanks
nick


<?php
$maxRows_WADAuser_usr = 500;
$pageNum_WADAuser_usr = 0;
if (isset($_GET['pageNum_WADAuser_usr'])) {
$pageNum_WADAuser_usr = $_GET['pageNum_WADAuser_usr'];
}
$startRow_WADAuser_usr = $pageNum_WADAuser_usr * $maxRows_WADAuser_usr;

$colparm_WADAuser_usr = "last_usr";
if (isset($_GET['sort'])) {
$colparm_WADAuser_usr = (get_magic_quotes_gpc()) ? $_GET['sort'] : addslashes($_GET['sort']);
}
mysql_select_db($database_conn_ArtCards, $conn_ArtCards);
$query_WADAuser_usr = sprintf("SELECT U1.id_usr, U1.memb_typ_usr, L1.label_lbl AS Memb_type, U1.active_usr, L2.label_lbl AS Active, U1.title_usr AS TI, U1.first_usr, U1.last_usr, U1.email_usr, U2.company_usr AS BEN, U1.benifitCode_usr,U1.memb_typ_usr FROM user_usr U1 LEFT JOIN label AS L1 On memb_typ_usr=L1.value_lbl LEFT JOIN label AS L2 ON active_usr=L2.value_lbl LEFT JOIN user_usr U2 ON U1.benifitCode_usr = U2.id_usr WHERE L1.group_lbl=5 AND L2.group_lbl=20 ORDER BY %s", GetSQLValueString($colparm_WADAuser_usr, "text"));
setQueryBuilderSource($query_WADAuser_usr,$WADbSearch1,false);
$query_limit_WADAuser_usr = sprintf("%s LIMIT %d, %d", $query_WADAuser_usr, $startRow_WADAuser_usr, $maxRows_WADAuser_usr);
$WADAuser_usr = mysql_query($query_limit_WADAuser_usr, $conn_ArtCards) or die(mysql_error());
$row_WADAuser_usr = mysql_fetch_assoc($WADAuser_usr);

if (isset($_GET['totalRows_WADAuser_usr'])) {
$totalRows_WADAuser_usr = $_GET['totalRows_WADAuser_usr'];
} else {
$all_WADAuser_usr = mysql_query($query_WADAuser_usr);
$totalRows_WADAuser_usr = mysql_num_rows($all_WADAuser_usr);
}
$totalPages_WADAuser_usr = ceil($totalRows_WADAuser_usr/$maxRows_WADAuser_usr)-1;
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...