Welcome Guest, Not a member yet? Register   Sign In
Disable Safe Query For Order_By
#1

Are there any way to disable Safe Query Protection for Order_By function of Query Builder?
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#2

There is a third parameter, that disables escaping so you can use complex expressions for sorting, you can set it to FALSE to disable escaping.

PHP Code:
    /**
     * ORDER BY
     *
     * @param    string    $orderby
     * @param    string    $direction    ASC, DESC or RANDOM
     * @param    bool    $escape
     * @return    CI_DB_query_builder
     */
    
public function order_by($orderby$direction ''$escape NULL
Reply
#3

I found undocumented third parameter.
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#4

It's not undocumented.
Reply
#5

If you read the documentatin carefully you will find the third one ;o)

http://www.codeigniter.com/userguide3/da...::order_by

But you're right in the examples you dont find them.

Reply
#6

Thank you but in search result of documentation i found this page for order_by :
http://www.codeigniter.com/userguide3/da...t=order_by

But there isn't any third parameter option at here.

I found it in class source code.
I'm a person from Turkiye. I don't know English very well and i can't write what i want to say sometimes (as now happenes  Blush ).

If i write something by mistake; please don't distress it and try to understand what i want to write.
Reply
#7

Yes there is: http://www.codeigniter.com/userguide3/da...::order_by

Not everything is shown as an example, that's why we included the Class Reference in the documentation.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB