From 9278249cd356411dc949dd5a6dacc5b07fd4be81 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 10 Aug 2007 11:26:01 +0000 Subject: Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only. --- system/database/DB_active_rec.php | 2 +- user_guide/changelog.html | 1 + user_guide/database/active_record.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index d79a068e3..82d5b63b7 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -405,7 +405,7 @@ class CI_DB_active_record extends CI_DB_driver { { if (trim($direction) != '') { - $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC', 'RAND()'), TRUE)) ? ' '.$direction : ' ASC'; + $direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' '.$direction : ' ASC'; } $this->ar_orderby[] = $orderby.$direction; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 730bfa343..d03fab5c8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@ Change Log
  • Added $assign_to_controller variable in the main index.php file. Anything that this variable contains will be passed automatically to a controller constructor when initialized.
  • Reorganized the URI and Routes classes for better clarity.
  • Javascript Calendar plugin now uses the months and days from the calendar language file, instead of hard-coded values, internationalizing it
  • +
  • Removed "rand()" as a listed option from orderby in the Active Record, as it was MySQL only.
  • Added titles to all user manual pages
  • Fixed a bug in database driver where num_rows property wasn't getting updated
  • Fixed a bug in captcha calling an invalid PHP function
  • diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 37629ae15..504f1831d 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -354,7 +354,7 @@ $this->db->orlike('body', $match);

    $this->db->orderby();

    Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. -The second parameter lets you set the direction of the result. Options are asc or desc or RAND()

    +The second parameter lets you set the direction of the result. Options are asc or desc

    $this->db->orderby("title", "desc");

    // Produces: ORDER BY title DESC -- cgit v1.2.3-24-g4f1b