close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

sorting with post variable

Thread began 2/24/2011 12:07 pm by Nico | Last modified 2/24/2011 12:42 pm by Dave Buchholz | 846 views | 1 replies |

Nico

sorting with post variable

Hi.
This may be already discussed but couldn't find any information.
I am using the 'sort server behavior' and it works great.
My only issue is that I don't want to use the $_GET method.
I can't get it to work using the $_POST method.

Am I doing something wrong or the 'sort server behavior' works with the $_GET['method'] ?

Thank you in advance.

Sign in to reply to this post

Dave BuchholzBeta Tester

If you are happy to hand code a solution then this is an example of how I would do it

php:
switch($_POST["sortBy"]) {

    case "newest":
    $orderClause = "tbl_products.tstampinsert DESC, tbl_products.title";
    break;
    case "a-z":
    $orderClause = "tbl_products.title, tbl_products.sortorder";
    break;
    case "z-a":
    $orderClause = "tbl_products.title DESC, tbl_products.sortorder";
    break;
    default:
    // default behaviour
    $orderClause = "tbl_products.sortorder, tbl_products.title";
}


mysql_select_db($database_connDB, $connDB);
$query_rsRecordsetName = "SELECT tbl_products.* FROM tbl_products ORDER BY " . $orderClause . "";
$rsRecordsetName = mysql_query($query_rsRecordsetName, $connDB) or die(mysql_error());
$row_rsRecordsetName = mysql_fetch_assoc($rsRecordsetName);
$totalRows_rsRecordsetName = mysql_num_rows($rsRecordsetName);
Sign in to reply to this post

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...